Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default How can I add another description field?

    I would like to add another description field in my layout.
    I attempted this by duplicating the following in
    tpl_product_info_display.php:


    <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div>
    <?php } ?>
    <!--eof Product description -->
    and changing the top one to:

    <!--bof Product description2 -->
    <?php if ($products_description2 != '') { ?>
    <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description2); ?></div>
    <?php } ?>
    <!--eof Product description2 -->


    Then I added another field in table products_descriptions
    and labeled it: products_descriptions2

    Then I populated it with some data on the record I was viewing, but it didn't work.


    I tried to figure out how to do this by also creating a new product type, but I couldn't even begin to complete that.


    Any ideas how to do this with the first or second method?

    thanks,
    Jeff Michaels
    Musical Creations Ltd.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I add another description field?

    The fields are pulled in the /includes/modules/pages/something_page_name/header_php.php in most cases

    You need to update the select statements and follow the patterns in there for setting the variables ...

    NOTE: these files are not override files so backup your original and your changes for future upgrades ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Re: How can I add another description field?

    Thanks Linda,

    I found very little info to change in:
    /includes/modules/pages/product_info/header_php.php
    so I changed nothing there...


    Then I looked at and modified:

    /includes/modules/pages/product_info/main_template_vars.php

    and I added the following:

    $sql = "select p.products_id, pd.products_name,
    pd.products_description2, pd.products_description, p.products_model,
    p.products_quantity, p.products_image,
    pd.products_url, p.products_price,
    p.products_tax_class_id, p.products_date_added,
    p.products_date_available, p.manufacturers_id, p.products_quantity,
    p.products_weight, p.products_priced_by_attribute, p.product_is_free,
    p.products_qty_box_status,
    p.products_quantity_order_max,
    p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter

    and

    $products_name = $product_info->fields['products_name'];
    $products_model = $product_info->fields['products_model'];
    $products_description = $product_info->fields['products_description2'];
    $products_description = $product_info->fields['products_description'];


    But this didn't display the new field on my product info pages...


    All I'm looking to do is display a new field: products_description2
    on the Product Info pages, above the original products_description


    Is there anything else I'm overlooking or doing wrong here?

    thanks,
    Jeff


  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I add another description field?

    What's wrong with this picture ...
    PHP Code:
     $products_description $product_info->fields['products_description2'];
    $products_description $product_info->fields['products_description']; 
    Perhaps add a 2 to that first one?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: How can I add another description field?

    duh!

    so sorry I miss that easy one....

    Anyway... IT WORKS!

    thanks so much
    I'll keep track of the file because of the "No overrides" problem on it too for future upgrading

    Jeff

  6. #6
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: How can I add another description field?

    Linda....

    One more problem has occurred now that the description2 field is appearing.

    I added image code in that text field (is that wrong? or is my code below for an image incorrect?)
    and here's what happens:
    As I refresh the page, it draws for a split second and then disappears.
    I put the word TEST after the image and it will display correctly.

    here's the code:

    <img src="MCimages/Back_Order.gif" Width=33 Height=26 Align=bottom>TEST

    thanks,
    Jeff

  7. #7
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: How can I add another description field?

    I forgot to add the double quotes around the width etc, but it still disappears when refeshing the page


    <img src="MCimages/backorder.gif" width="33" height="26">test


    Here's the link to view the test site:

    http://64.40.85.238:84/index.php?mai...ts_id=40422178

    the image is supposed to appear BEFORE the word TEST

  8. #8
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: How can I add another description field?

    And yes, I have checked and rechecked that the image is in fact in the folder.
    Also, I replaced that image with one in the top level (not MCimages) and it won't work either


    confused here

    thanks,
    Jeff

  9. #9
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: How can I add another description field?

    Never mind Linda,

    I figured out that if you create a new field like this, the connections for the proper image folders were never linked yet.

    So all I did was make the image link: images/MCimages/backordered.gif
    by adding 'images/ to the statement and the image came up correctly.

    thanks,
    Jeff

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I add another description field?

    Thanks for the update and glad to hear that you have this working now ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Ideal Layout Example & Possible to Add Another Description Field?
    By laurenjj in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Sep 2008, 09:30 PM
  2. Replies: 0
    Last Post: 24 Jun 2008, 06:54 PM
  3. How can I add another description field?
    By jeffmic in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Sep 2006, 05:14 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR