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
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
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)
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.
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)
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
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'!
Similar earlier thread, with code, at
http://www.zen-cart.com/forum/showthread.php?t=54295
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.
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>') ;