It worked! You have to turn the description on in the Product listing configuration. Cheers
It worked! You have to turn the description on in the Product listing configuration. Cheers
hand screen printed clothing and accessories
www.wildgardendesign.com
ok, i'm now trying to add the manufacturer to the featured products listing and have figured out that I need to create the variable for this. It's this at the moment- but it's not working.
$manufacturers_name = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $featured_products->fields['manufacturers_id']) . '">' . $featured_products->fields['manufacturers_name'] . '</a>';
I'm not very good at php so can someone please work out what this needs for it to work. I have put '$manufacturers_name' where it should show in the listing
hand screen printed clothing and accessories
www.wildgardendesign.com
Fixing broken code strings from etrader's post #8:
This is how to add the product description to the featured products box on the home page:
1. Copy the file: includes/modules/featured_products.php
2. Place it in an overrides folder like this:
includes/modules/your_template/featured_products.php
3. Add the code for the 'product description' and 'more info link' variables:
4. Replace the $list_box_contents variable with this code:PHP Code:
$products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);
$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>';
5. Upload the file to your overrides folder.PHP Code:
$list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(zen_get_info_page($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']), 'products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a><br />' . $products_price . '<br />' . $products_description . $info_link);
Note: You can add the product description to the specials box by editing the specials_index.php file. Just replace all instances of $featured_products with $specials_index
thank u . i copy / plaste the code modules\classic\featured_products.php , then in my test home page display the more info ... but the featured products description do not display ...
This update worked perfectly thanks, any idea though how to get the image to move to the left and the text to the right, instead of the way it show here
www.weddingandgems.co.uk
Thanks
I got the image to move left by using a table. Here's my code.
Code:$list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<table border="0" width="100%" cellspacing="2" cellpadding="2"><tr><td><a href="' . zen_href_link(zen_get_info_page($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></td><td><br /><a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a><br />' . $products_price . '<br />' . $products_description . $info_link . '</td></tr></table>');
However, I cannot get the description to show. I checked the configuration setting, and it is on. but no show. What did you do? what version are you running?
K
Hi, I needed this as well, but did not get the description to show in the current zen cart 1.3.8a. Nor does the link work, although the title link worked before and still works.
Appreciate the code posted here for that and image left, any help with why this might not work in the current version???
Thank you,
Julie
Julie, follow the thread at:
http://www.zen-cart.com/forum/showthread.php?t=103349
It is more salient at the moment.
Kris
Ignore my last post...sorted..
i.e.
Code:$products_price = zen_get_products_display_price($featured_products->fields['products_id']); $products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION); 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']); $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<a href="' . zen_href_link(zen_get_info_page($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']), 'products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a><br />' . $products_price . '<br />' . $products_description . $info_link);
Bookmarks