Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,244
    Plugin Contributions
    20

    Default Pre-populating product description

    The answer to this was published 2 or 3 years ago (before we moved to the new forum) - but I've forgotten how to do it!

    I have a client who has the same table of information going into every product description. How can I pre-populate the htmlarea text box to save him having to cut and paste each time? Or more specifically, which is the file I need to edit to include this html?
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  2. #2
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Pre-populating product description

    tpl_product_info_display.php (perhaps)

    hard-code your html into this part...

    <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div>
    <?php } ?>
    PROBABLY PUT IT HERE... CREATE DIVS WITH STYLE ID'S SO YOU CAN CONTROL LAYOUT USING CSS
    <!--eof Product description -->

  3. #3
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: Pre-populating product description

    This might be of use in this case: http://www.thatsoftwareguy.com/zenca...scription.html
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  4. #4
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,244
    Plugin Contributions
    20

    Default Re: Pre-populating product description

    I didn't explain myself properly but thank you both (and that is a good pointer barco57)

    When entering product data, the client wants a consistent table where he can enter different content depending on the product, so it's a case of the text editor (HTMLarea) displaying the description data entry box already containing the table layout.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  5. #5
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: Pre-populating product description

    Ahhhhh I see now.....nope don't know how to pull that one off......My wife suggests using http://www.shortkeys.com/ depending on how long the code block is for the tables you could drop the code in with some sort of key combination.....my wife uses it all the time when entering products cause she has a standard description that only needs a few changes, so she decided its much faster to use a odd letter combination to drop it in and then she only has to change a couple of things.
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  6. #6
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,244
    Plugin Contributions
    20

    Default Re: Pre-populating product description

    Found it! 17 Apr 2005... started to write the instructions and obviously never finished it

    The original guidance came from DrByte, but for anyone else who wants to do something similar, the file to edit is admin/includes/modules/product/collect_info.php and around line 412 you should find
    Code:
              echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', (isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id'])); //,'id="'.'products_description' . $languages[$i]['id'] . '"');
    replace this with
    Code:
              $textarea_content = (isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']);
    if ($textarea_content == "") {
       $lines = file(DIR_FS_CATALOG . 'extras/default_html_content_for_products.html');
       foreach ($lines as $line) {
         $textarea_content .= trim($line);
       }
    }
             echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '600', '20', $textarea_content);
    REMEMBER the above is a core file so keep a backup - it will be overwritten in an upgrade (as mine was, but I did have the backup...just couldn't remember where the heck it was! LOL)

    Create your html content in a file such as that named in red above and place in your extras directory.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  7. #7
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Pre-populating product description

    Rick, now you need to write it down on a PostIt and stick it on your forehead.

 

 

Similar Threads

  1. Pre installed Product Descriptions
    By MartynG in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 24 Dec 2011, 02:51 PM
  2. Purchase wizard pre-populating a product page
    By now4w in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 9 Mar 2011, 08:42 PM
  3. Pre Populate Product Description Field?
    By PGlad in forum Basic Configuration
    Replies: 4
    Last Post: 10 Nov 2010, 06:58 PM
  4. Can I Remove Categories from Populating in Description and Keywords?
    By mycomputerbuddy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Jan 2009, 07:37 AM

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