Forums / Templates, Stylesheets, Page Layout / Show product description on main-page?

Show product description on main-page?

Locked

Views: 19,523

Results 1 to 20 of 67
This thread is locked. New replies are disabled.
13 Jun 2006, 4:32 PM
#1
gustafr avatar

gustafr

New Zenner

Join Date:
May 2006
Posts:
26
Plugin Contributions:
0

Show product description on main-page?

Hi,

Is there a switch in admin to make the product-description show on the main-page on featured products? It only shows product name and price.
I have found out how to control the featured product listing but not how to adjust this on the index-page.

/G

13 Jun 2006, 5:38 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Show product description on main-page?

If you are using v1.3.x, the featured listing can be set to display the first 150 characters of the description, in Configuration > Featured Listing > Display Product Description.

If you are wanting something other than this, please explain or post a url to the place you mean.

13 Jun 2006, 7:10 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show product description on main-page?

While the Listings each have an option for the products_description to be displayed ... the Center Boxes do not have built in the products_description ...

You can customize these to include this information ... however, there is not a switch for the Center Boxes to include the products_description at this time ...

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!]
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!

18 Sep 2006, 9:34 PM
#4
reap avatar

reap

New Zenner

Join Date:
Sep 2006
Posts:
13
Plugin Contributions:
0

Re: Show product description on main-page?

could you point us in the right direction? I am having a hell of a time getting the featured_products.php to show the descriptions and adding a buy now button. I see a few people who want to do the same thing but no one is showing us n00bs how to. :D I have been trying to figure out how for about 4 hours now with no luck.

help!

19 Sep 2006, 2:22 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show product description on main-page?

Might peek at how the product listing or new product listing or all product listing or featured product listing are so smart and adjust the center boxes to be equally smart ... :smile:

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!]
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!

19 Sep 2006, 11:32 AM
#6
etrader avatar

etrader

New Zenner

Join Date:
Dec 2005
Posts:
62
Plugin Contributions:
0

Re: Show product description on main-page?

To add the product description to the featured centrebox, I guess you would need to edit the following code in modules/featured_products.php and maybe also add some code to the sql query.


$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);

Can someone show us how to adjust the code so it displays the same as the featured product listings?

25 Oct 2006, 6:49 AM
#7
wildgarden avatar

wildgarden

New Zenner

Join Date:
Apr 2006
Posts:
32
Plugin Contributions:
0

Re: Show product description on main-page?

I would also like to know how to add manufacturer name to the featured/new products page on the homepage and am stumped. Can't figure out what I need to do with the php code- this is beyond my web designer abilities. Any more hints?

hand screen printed clothing and accessories
https://www.wildgardendesign.com

5 Nov 2006, 12:40 AM
#8
etrader avatar

etrader

New Zenner

Join Date:
Dec 2005
Posts:
62
Plugin Contributions:
0

Re: Show product description on main-page?

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

  1. Add the code for the 'product description' and 'more info link' variables:

    $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>';

  2. Replace the $list_box_contents variable with this 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);

  1. Upload the file to your overrides folder.

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

7 Nov 2006, 6:27 AM
#9
wildgarden avatar

wildgarden

New Zenner

Join Date:
Apr 2006
Posts:
32
Plugin Contributions:
0

Re: Show product description on main-page?

Thanks but I tried this and the description still doesn't show?! Also can you please help me with adding the manufacturer name

hand screen printed clothing and accessories
https://www.wildgardendesign.com

7 Nov 2006, 9:06 AM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Show product description on main-page?

Did you perhaps cut & paste from etrader's post? There are some long lines that the forum software split, even breaking a function name. If you didn't restore the code that might be the problem.

7 Nov 2006, 10:32 PM
#11
wildgarden avatar

wildgarden

New Zenner

Join Date:
Apr 2006
Posts:
32
Plugin Contributions:
0

Re: Show product description on main-page?

It worked! You have to turn the description on in the Product listing configuration. Cheers

hand screen printed clothing and accessories
https://www.wildgardendesign.com

7 Nov 2006, 11:41 PM
#12
wildgarden avatar

wildgarden

New Zenner

Join Date:
Apr 2006
Posts:
32
Plugin Contributions:
0

Re: Show product description on main-page?

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
https://www.wildgardendesign.com

30 May 2008, 8:00 AM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Show product description on main-page?

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

  1. Add the code for the 'product description' and 'more info link' variables:
$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>';
  1. Replace the $list_box_contents variable with this 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);
  1. Upload the file to your overrides folder.

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

19 Jun 2008, 5:36 PM
#14
ebloger avatar

ebloger

New Zenner

Join Date:
Dec 2007
Posts:
35
Plugin Contributions:
0

Re: Show product description on main-page?

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 ...
:frusty:

28 Jun 2008, 8:56 PM
#15
kezan98 avatar

kezan98

Zen Follower

Join Date:
Nov 2007
Location:
UK
Posts:
98
Plugin Contributions:
0

Re: Show product description on main-page?

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

https://www.weddingandgems.co.uk

Thanks

20 Jul 2008, 7:02 PM
#16
klagreca avatar

klagreca

New Zenner

Join Date:
Jul 2008
Posts:
7
Plugin Contributions:
0

Re: Show product description on main-page?

I got the image to move left by using a table. Here's my 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

11 Aug 2008, 10:17 AM
#17
askjv avatar

askjv

New Zenner

Join Date:
Dec 2006
Posts:
21
Plugin Contributions:
0

Re: Show product description on main-page?

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

20 Sep 2008, 8:02 AM
#19
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Show product description on main-page?

gjh42:

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

  1. Add the code for the 'product description' and 'more info link' variables:

$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>';

> 4. Replace the $list_box_contents variable with this code:
> ```php
$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);
  1. Upload the file to your overrides folder.

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
Could you explain please, where exactly in
includes/modules/your_template/featured_products.php
these additions go? TIA

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

20 Sep 2008, 8:32 AM
#20
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Show product description on main-page?

Ignore my last post...sorted..
i.e.

 
  $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);
 
 

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others