Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Multiple Descriptions

    Ok, I didn't get from your OP exactly what it was that you wanted. The two sections of description on the product info page separated by other stuff would be best done with two different fields. The capsule description on the listing page could easily be handled by the method above. And you didn't actually want the all products page at all.

  2. #2
    Join Date
    Jan 2006
    Posts
    229
    Plugin Contributions
    0

    Default Re: Multiple Descriptions

    Right - I agree that the "capsule description" (on the product listing page) could be handled by the "display:none;" method - that's definitely doable. But I still need the separation on the product detail page - which (like you said ;) ) would be great if I could have the additional field.

    I've actually been playing with this, and I've gotten a bit of it to work - I can get the fields to show up in the admin panel, but I'm having an issue getting the information intered into the new form fields to pass to the new database fields I made for them.

    Basically, I went into my database and went into the "zen_products_description" table. I added two new fields, and set them up exactly like the original "products_description" field (products_description2 and products_description3). I've gotten the fields - like I said - to show up in the admin panel, no problem. But I'm having an issue getting any input placed in the two new form fields to pass to the database fields. I'm working on admin/functions/general.php, and trying to get this section to get coded properly to do 3 fields at once:

    Code:
      function zen_get_products_description($product_id, $language_id) {
        global $db;
        $product = $db->Execute("select products_description 
                                 from " . TABLE_PRODUCTS_DESCRIPTION . "
                                 where products_id = '" . (int)$product_id . "'
                                 and language_id = '" . (int)$language_id . "'");
    
        return $product->fields['products_description'];
    
    }
    This is on a localhost server, by the way, and I'm just "playing" - so if I screw anything up majorly, it won't be a big deal ;) I'm not that great at MySQL stuff, so what I've tried is all "trial and error" - but if there's any clue how to get the 3 form fields to pass the information to the proper database fields, that would rock. I htink I could figure out the rest from there - I just need to get the info into the database.

  3. #3
    Join Date
    Jan 2006
    Posts
    229
    Plugin Contributions
    0

    Default Re: Multiple Descriptions

    Just wanted to update - I did it! (Call me a nerd, but I'm so proud of myself!) I found this tutorial and used it as a base for what I was doing. So I was thinking correctly, but I was taking it a little too far. (By the way, the above code was correct - but it's what *gets* the value from the new database field - not *posts* it - my bad!)

    Anyway, I'm so excited about this thing that I plan on working out the kinks and posting it on my site. I may be able to make a contribution out of it, but I don't think I'm that good. But thanks for the assistance, all :)

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Multiple Descriptions

    Glad you made this work. If you can package it into a contribution, I'm sure a lot of people would thank you. Someone else just asked today about doing this.

    For those who don't want to get into building new database tables and files, there is a way to use the CSS method above for separate description blocks on one page without the hassle of trying to use absolute positioning on dynamic elements.

    Enter all the different parts you want to display, with <span id=productDescList>text text text</span><span id=productDesc1>text text text</span><span id=productDesc2>text text text</span> tags around each section.
    Put the short description for listing pages in productDescList, and blocks for the info page in 1, 2, etc.

    Copy the product description block in tpl_product_info_display to all the locations where you want to display a section of text, and give each block (including the original) a separate id.
    PHP Code:
     <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <div id="productDescription1" class="biggerText productGeneral"><?php echo stripslashes($products_description); ?></div>
    <?php ?>
    <!--eof Product description -->
    <br class="clearBoth" />
    Give any desired styling to each description block.
    In your stylesheet, find #productDescription and change it to #productDescription1. Below that declaration, add

    #productDescription2 {your desired styling} etc.

    Next, turn off all display of productDesc1 and productDesc2 etc., and #productDescList in the product info page, and turn them on again selectively.

    Code:
    #productGeneral #productDescList, #productDesc1, #productDesc2 { display: none }
    
    #productDescription1 #productDesc1 { display: block; } //or inline;
    
    #productDescription2 #productDesc2 { display: block; }
    The desired parts of the description will display in their respective locations.


    Disclaimer: I haven't tested this implementation yet, so if anything doesn't work as expected, ask and we'll sort it out.

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Multiple Descriptions

    PS - Remember, you will also need to enable HTML in product listing pages (& all, featured & new pages) as mentioned in posts #3 & 4 above.

  6. #6
    Join Date
    Jan 2006
    Posts
    229
    Plugin Contributions
    0

    Default Re: Multiple Descriptions

    For the record, I *did* post a how-to on my site. I also figured out how to get Easy Populate to work with it, so you can import/export the added fields. So if anyone wants to see/use it for the future, please feel free:

    Edit ZenCart for Extra Fields:
    http://anekostudios.com/2007/04/25/m...t-zencart-tip/

    Edit Easy Populate to work with the above:
    http://anekostudios.com/2007/05/01/e...easy-populate/

    Hope it helps someone. (And when I figure out how to do "contributions" then I'll submit it :) )

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Multiple Descriptions

    Just took a look at your site while researching an answer - that is a sweet tutorial! The complete step-by-step makes it thoroughly comprehensible and non-threatening to the newbie. Good work!

 

 

Similar Threads

  1. Multiple descriptions for one product
    By rapro in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 May 2010, 06:48 AM
  2. Replies: 1
    Last Post: 20 Feb 2009, 11:44 PM
  3. Can a product have multiple descriptions and prices
    By nuroweb in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 4 Mar 2008, 06:04 PM
  4. Multiple Image Title/Descriptions
    By monkeyjr47906 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 20 Dec 2007, 08:03 PM
  5. Editing Product descriptions on multiple items
    By 5869 in forum General Questions
    Replies: 0
    Last Post: 1 Nov 2007, 07:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg