Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / how do I make "buy it now" link in featured products on the front page?

how do I make "buy it now" link in featured products on the front page?

Locked
This thread is locked. New replies are disabled.
6 Jul 2009, 8:12 PM
#21
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Post #21 by spawnie69

milkyway:

This is incorrect:

$product_addtocart=zen_href_link( $_GET['main_page'], 'products_id=' . $product_id .'&action=buy_now');

> 
> It should be:
> 
> ```php
$product_addtocart = zen_get_buy_now_button($featured_products->fields['products_id'],'<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ');

I am not a coder, I just use dreamweaver for html and some php editing.

Pardon my ignorance but can you please tell me where this PHP code gets inserted to?
Love what you did for your client, this is pretty much I would like.

Thanks
-spawnie69

16 Dec 2010, 10:53 AM
#22
zillionzillion avatar

zillionzillion

New Zenner

Join Date:
Dec 2010
Posts:
4
Plugin Contributions:
0

Post #22 by zillionzillion

I am using 1.3.9h.

I am trying to add an add to cart box/button on every featured product on the main page.

I tried to add

$add_code .='. <a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="my image link" />' . '</a>';

It doesn't work.

How can I add an add to cart box/button on every featured product on the main page?

Please help.