Forums / Templates, Stylesheets, Page Layout / Add "More Info" Button on Product Descriptions

Add "More Info" Button on Product Descriptions

Locked

Views: 1,899

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
6 Feb 2010, 9:09 PM
#1
vipoptics avatar

vipoptics

New Zenner

Join Date:
Sep 2009
Posts:
17
Plugin Contributions:
0

Add "More Info" Button on Product Descriptions

This is probably just an easy HTML fix. My Product description is way long, and I want to make it so that it just has the product overview, then the customer can click on the "More Info" text and the rest of the description will appear. I hope that makes sense... Thanks in advance for the help.
VIP

6 Feb 2010, 11:43 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Add "More Info" Button on Product Descriptions

You can customize the product_listing module by adding on to the description for this section of code around lines 97 - 101 using your templates and overrides:

        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
        } else {
          $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
        }

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!

7 Feb 2010, 2:42 AM
#3
vipoptics avatar

vipoptics

New Zenner

Join Date:
Sep 2009
Posts:
17
Plugin Contributions:
0

Re: Add "More Info" Button on Product Descriptions

OK, Thanks for the quick response... What will that do, exactly? Will I be able to insert the "more info" where I want, or what will it do? And will the side picture and the add to cart move up if I do that? Ex. http://www .vipoptics. com/index.php?main_page=product_info&cPath=88_1&products_id=181 (On the left side)

Thanks again,
VIP

7 Feb 2010, 5:57 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Add "More Info" Button on Product Descriptions

This section of code displays the products_description ... if you added on to it a more information button it would be at the end of the description ...

If you want to add a button or text to where the add to cart button is, then you need to locate that part of the code in that file ...

If you look through the case statements you will see where the various parts of the listing are built and can add the button or text to any portion of it ...

Try to add:

. '<br>Hello World'

to any part of the code to test where it is being added ...

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!

10 Feb 2010, 5:02 PM
#5
robertg avatar

robertg

Zen Follower

Join Date:
Nov 2009
Posts:
341
Plugin Contributions:
0

Re: Add "More Info" Button on Product Descriptions

Good Morning.
I uploaded the code to includes/modules/MyTemplate/product_listing.php & to includes/modules/product_listing.php.
I also added after product_list_description the " <BR>Hello World'.
I just can't see where it's suppose to come up. I also don't see any changes in the admin/configuration/product listing page.
I really would like to be able to use this idea, since I too have certain items that are text & specification heavy.
Thanks in advance for your help

26 Feb 2010, 2:10 AM
#6
webman avatar

webman

New Zenner

Join Date:
Sep 2005
Location:
Adelaide South Australia
Posts:
31
Plugin Contributions:
0

Re: Add "More Info" Button on Product Descriptions

Hi Robert,

If you replace the code Ajeh noted earlier, on or around lines 94 tp 102 of product_listing.php, with the following it should achieve the desired results;

Please remember, as with any file modification remember to save the modified file in your custom template folder.

break;
        case 'PRODUCT_LIST_NAME':
        $lc_align = '';
        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . ' <a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>' ;
        } else {
          $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . ' <a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
        }
break;
27 Feb 2010, 10:52 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Add "More Info" Button on Product Descriptions

How would one display the ADD TO CART button, AND the "More Info" Text - at the same time?

Right now, it's either/or ... depending on a product's attributes status.

But I have a client with products that don't have attributes, and he wants BOTH the "Add to Cart" functionality - (depending on what has been configured in the admin panel) - and the "more info..." link.

20 years a Zencart User

28 Feb 2010, 7:22 AM
#8
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Add "More Info" Button on Product Descriptions

Managed to sort it out via various threads that discuss the module file, product_listing.php .

Thanks mostly to Linda who provided the guidance!

20 years a Zencart User