给ZENCART首页的 New Products加上add to cart按钮

给ZENCART首页的 New Products加上add to cart按钮


�oNew Products模�K加按�o

打�_文件includes\modules\new_products.php,搜索

  1. $products_price = zen_get_products_display_price($new_products->fields['products_id']);


在下面加上�尚校�

  1. $products_desc = substr(strip_tags(trim(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))),0,100).'…';

  2. $buy_now_link = zen_get_buy_now_button($new_products->fields['products_id'],'<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) .'<br/>'.'</a>&nbsp;<br /');


其中按�o的�量是$buy_now_link,把它安置在自己想要的地方即可,我是加在$products_price後面的。其中$products_desc是�b品描述,如果需要也可以添加上去



你可能感兴趣的:(zencart)