Contributions

Features (Category Index)
Search: 

Add Buy Now or Add To Cart Buttons to Homepage (New Products Section)

This module adds Buy Now or Add To Cart Buttons to Homepage (New Products Section). I don't know if this is already available but I couldn't find it so I have added it myself. Hope someone find it useful.

Expand All / Collapse All

How to make it work with featured products contribution 13 Jan 2010

In catalog > includes > modules > featured.php find:

$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="33%" valign="top"',
'text' => '
<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $products_price);

---------------

Replace it with this:

$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="33%" valign="top"',
'text' => '
<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">'

. tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

. '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">'

. $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id']))

. '<br><br>' . tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'products_id=' . $featured_products['products_id'] . '&action=add_product')) . tep_draw_hidden_field('products_id', $featured_products['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_IN_CART) . '</form>');

-------------

That's all :)

No fle attached

Add Buy Now or Add To Cart Buttons to Homepage (New Products Section) 21 Sep 2009

Note: Contributions are used at own risk.