Forums / Templates, Stylesheets, Page Layout / Adding a Product Details Button to the Featured Products Page

Adding a Product Details Button to the Featured Products Page

Locked

Views: 2,894

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
7 Jul 2009, 9:12 PM
#1
susb8383 avatar

susb8383

Zen Follower

Join Date:
Feb 2008
Posts:
129
Plugin Contributions:
0

Adding a Product Details Button to the Featured Products Page

The default on the Featured Products box on the home page just had a link to the product details if you clicked on the product name or the image. But this wasn't obvious to my visitors. I kept getting emails that said they couldn't figure out how to add it to the cart. So I created a big obvious button that says Product Details.

Note that I didn't just want to have an Add to Cart button because one of my products requires the visitor to choose color, mount, etc. and I didn't want to have all these drop downs on my home page.

I know there have been lots of posts about how to add things to the Featured Products page, but after reading them, I still didn't get it.

But I got it to work, so thought I'd post it.

So to do it:

  1. Create a gif for your product details button. Name it button_product_details.gif and put it in the includes/templates/YOURTEMPLATE/buttons/english folder.
  2. Edit includes/languages/english/YOURTEMPLATE/button_names.php. Add these two lines:
define('BUTTON_IMAGE_PRODUCT_DETAILS', 'button_product_details.gif');
define('BUTTON_PRODUCT_DETAILS_ALT', 'Product Details');
  1. In includes/modules/YOURTEMPLATE/featured_products.php (make a backup first), find the section near the bottom that starts with $list_box_contents[$row][$col] =
  2. Figure out where you want to add the button. I wanted to have it last, after the product price. In my template (cherry zen), that section ends with . $products_price);. So I changed
    . $products_price);
    to
. $products_price . '<br /><a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_PRODUCT_DETAILS , BUTTON_PRODUCT_DETAILS_ALT) . '</a><br />');

If you want to see what this looks like, you can check out my site
Pet Exercise Wheels

It's not a very fancy site, but I'm not much of a PHP programmer.

So anyway, hope this was helpful.

29 Dec 2009, 4:27 PM
#2
pathan avatar

pathan

New Zenner

Join Date:
Dec 2009
Posts:
19
Plugin Contributions:
0

Re: Adding a Product Details Button to the Featured Products Page

Thanks a lot. Can you tell me how to change orderr of product info in this area? I want to put Title 1st than image and price at last.