PDA

View Full Version : Add Buy Now or Add To Cart Buttons to Homepage (New Products Section)



michael_s
01-13-2010, 01:00 PM
In catalog > includes > modules > featured.php find:

$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="33%" valign="top"',
'text' => '
' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ' (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . ')
' . $featured_products['products_name'] . ' (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . ')
' . $products_price);

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

Replace it with this:

$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="33%" valign="top"',
'text' => '
'

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

. ' (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . ')
'

. $featured_products['products_name'] . ' (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . ')
' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id']))

. '

' . 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) . '');

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

That's all :)

No fle attached

More... (http://addons.oscommerce.com/info/7029)