Page 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 67
  1. #31
    Join Date
    Apr 2009
    Posts
    29
    Plugin Contributions
    0

    Default Re: Show product description on main-page

    Finally figured that out my searching "more info" in the development tool kit. Found the snippet of code I needed in includes/modules/new_product_php.

    $info_link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '"> more info...</a>';


    I added that to my includes/modules/my_template/featured_products.php after this code:

    if (!isset($productsInCategory[$featured_products->fields['products_id']])) $productsInCategory[$featured_products->fields['products_id']] = zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']);

    and that did the trick. That took me about six months to figure out! Not that I understand how it works...

  2. #32
    Join Date
    Apr 2009
    Posts
    29
    Plugin Contributions
    0

    Default Re: Show product description on main-page

    I obviously had that completely wrong but am on the right track. Any help would greatly be appreciated!

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

    Default Re: Show product description on main-page

    zen_trunc_string() is the function that truncates output to a specified length (carefully trimming to leave full words), so looking for that in product_listing.php should help you get the functionality elsewhere.

  4. #34
    Join Date
    Oct 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Show product description on main-page?

    Hi, I am in v. 1.3.8 (not 1.3.8a). I am using Featured Products on my main page. I need to add the manufacturer's name (not wanting it to read "manufacturer:suchandsuch", just wanting it to read "suchandsuch") below the image. Removed the price using the tips above and now have image + the product name (which I want to remove, too).

    **Ultimately, want only image with manufacturer's name beneath to appear on page.**

    Here's the code I have currently (as recommended above) that needs to be modified:

    $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a><br />' . $products_price);

    I think I also need a snippet similar to this example:

    $products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($featu red_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);

    except that I need it for manufacturer, instead of description.

    Please help?
    Thank you so much!


  5. #35
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Show product description on main-page

    $product_info_str .= '</td><td class="productBoxContent" valign="top">';

    $product_info_str .= '<table width="100%" cellspacing="0" cellpadding="0"><tr>';
    $product_info_str .= '<td class="productBoxDescription" valign="top">';
    $product_info_str .= (strlen($product->fields['products_description']) > 50) ? substr(strip_tags($product->fields['products_description']), 0, 50) . '&hellip;' : strip_tags($product->fields['products_description']);
    $product_info_str .= '</td></tr><tr><td>';
    $product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_more_info.gif" class="noborder" alt="" />' . '</a>';
    $product_info_str .= '</td></tr><tr><td height="4"></td></tr><tr><td>';
    $product_info_str .= '<a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_buy_now.gif" class="noborder" alt="" />' . '</a>';
    $product_info_str .= '</td></tr></table>';

    $product_info_str .= '</td';
    $product_info_str .= '</tr></table>'; // productBoxContent
    Anyone see why the descriptions arnt showing on "New Products"....

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

    Default Re: Show product description on main-page?

    This might not work too well:
    $product->fields['products_description']

    But later, you are using for the fields:
    $new_products->fields['products_id']

    Which one are you really using?

    NOTE: you need to clean up a few things in there, if this is the case ...
    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!

  7. #37
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Show product description on main-page?

    Quote Originally Posted by Ajeh View Post
    This might not work too well:
    $product->fields['products_description']

    But later, you are using for the fields:
    $new_products->fields['products_id']

    Which one are you really using?

    NOTE: you need to clean up a few things in there, if this is the case ...
    I am trying to get the descriptions to display in the New Products box on the main page...

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

    Default Re: Show product description on main-page?

    You need to use the correct references to the fields that you pulled with your select statement ...

    I think you have mixed references ...

    I believe if you change all:
    $product->fields

    to read:
    $new_products->fields

    This would fix the problem ...

    NOTE: if your SELECT statement does not pull the:
    products_description

    field, then you will need to customize things further ...

    Look at the:
    $new_products_query

    and see if the:
    products_description

    field is being pulled from the database in the two selects for the:
    $new_products_query

    If not, you need to add it ... follow the references to:
    products_name

    to see where and how it is gathered ...
    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!

  9. #39
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Show product description on main-page?

    Okay, just to test a theory, i added the "new_products.php" from another template that does being up the description on the New Products box.

    When i added that file it still didnt bring up the descriptions in the box, is it possible they have removed the coding from else where ?

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

    Default Re: Show product description on main-page?

    Make sure you are addressing the right code ...

    The Centerbox for the New Products is different than the New Products page ...

    In the module:
    /includes/modules/new_products.php

    you would copy to your templates and overrides directory ...

    Then you need to customize the code ...

    First, the two select statements:
    Code:
      $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                    p.products_date_added, p.products_price, p.products_type, p.master_categories_id, pd.products_description
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                               where p.products_id = pd.products_id
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                               and   p.products_status = 1 " . $display_limit;
    Code:
        $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                      p.products_date_added, p.products_price, p.products_type, p.master_categories_id, pd.products_description
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                               where p.products_id = pd.products_id
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                               and p.products_status = 1
                               and p.products_id in (" . $list_of_products . ")";
    Then, to display the description cleanly, you can use:
    Code:
        $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
        'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price . '<br>' . zen_trunc_string(zen_clean_html(stripslashes($new_products->fields['products_description']))) );
    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 4 of 7 FirstFirst ... 23456 ... LastLast

Similar Threads

  1. v155 Product description on main page
    By vvomble in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 2 Jun 2016, 03:40 PM
  2. how do you omit description of product on main product page?
    By rubis in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 Mar 2009, 04:25 PM
  3. Changing description on my main product page
    By 9800xl in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Aug 2007, 05:03 PM
  4. Product Description Issues on main page
    By magneteye in forum General Questions
    Replies: 8
    Last Post: 20 Jul 2007, 10:04 AM
  5. Getting subcategory description to show up on the Product page
    By lyricwings in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 11 Apr 2007, 11:11 PM

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