Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2007
    Posts
    195
    Plugin Contributions
    0

    Default Product description on home page?

    Hi, I'd like to have have a product description under the 'new products' which are displayed on the home page, rather than just the product name and price. Does anyone know how to do this please?

    Thanks
    Patrick

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Product description on home page?

    It involves programming. Basically you need to tweak the includes/modules/new_products.php file to add the products_description to the database extract (line 40) and then add the result to the text field for $list_box_contents (line 71)

    (line numbers for Zen cart 1.3.8a)
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jun 2007
    Posts
    195
    Plugin Contributions
    0

    Default Re: Product description on home page?

    I tried doing this but got the error:

    1054 Unknown column 'p.products_description' in 'field list'
    in:
    [select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_date_added, p.products_description from products p where p.products_status = 1 and p.products_date_added >=20080422]


    Problem is I'm no programmer so just really guessing at what I need to do here.

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Product description on home page?

    It would need to be pd.products_description, but looking at your error suggests that either you are using an old version pf Zen Cart, or that you're in the wrong file, as there's no reference to the product descriptions table in there.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Jun 2007
    Posts
    195
    Plugin Contributions
    0

    Default Re: Product description on home page?

    Ah, thanks for spotting that. Although I've upgraded to 1.3.8a, some of the overrides on my site were still from the previous version.

    I've now acheived what I wanted to do. Thanks for your help!

    Patrick

  6. #6
    Join Date
    Jun 2007
    Posts
    195
    Plugin Contributions
    0

    Default Re: Product description on home page?

    Well I've got my descriptions showing, but would appreciate a little help with formatting if anyone can point me in the right direction. Here is the code block from new_products.php

    $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><br>' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($new_p roducts->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)) ;

    The product image, name, price and description all appear centered one above the other at http://www.diva############s.co.uk/test/index.php. What I want to do is use a table (or divs?) so that I can position image, name, and price on one side of the table (centered), with the description on the right side of the table (left aligned). I've been fiddling around with various ideas for ages but my lack of coding ability has left me stumped. I keep coming up with a bank page, or a list of capital 'As'!

  7. #7
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Product description on home page?

    Similar earlier thread, with code, at
    http://www.zen-cart.com/forum/showthread.php?t=54295

  8. #8
    Join Date
    Jun 2007
    Posts
    195
    Plugin Contributions
    0

    Default Re: Product description on home page?

    Thanks for the pointer Misty, but this doesn't really address my issue. I don't have a problem displaying the description, that works fine, I need to change the layout of the resulting page. As I said, I've tried to add a table to the code so I can control where each block of code is displayed on the page, but I can't figure out where to place the html tags for the table.

  9. #9
    Join Date
    Jun 2007
    Posts
    195
    Plugin Contributions
    0

    Default Re: Product description on home page?

    Well I finally figured this out for myself after much trial and error. So for anyone else who wants to include their images and discriptions in a table here is the code:

    $list_box_contents[$row][$col] = array('params' => '' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<table width="100%" border="0"><tr><td width="25%" align="center"><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 . '</td><td width="75%">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($new_p roducts->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION). '</td></tr></table>') ;

 

 

Similar Threads

  1. Description on home page and custom boxes
    By freya in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Dec 2012, 12:47 AM
  2. Extra Category Description on home page.
    By DigitalGuard in forum General Questions
    Replies: 4
    Last Post: 19 Mar 2011, 01:35 AM
  3. Home page meta description
    By Alex Clarke in forum General Questions
    Replies: 1
    Last Post: 8 Oct 2008, 06:27 PM
  4. Home Page Description
    By NancyOK in forum Basic Configuration
    Replies: 1
    Last Post: 27 Aug 2006, 08:17 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