zencart首页显示产品描述、“Add to Cart”和“buy now”

用于收藏精华贴子、网友共享的资料等。可以回复,不能发新贴。

版主: Jack

版面规则
本版面不能发新贴,可以回复

zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子xiao_min » 2010-10-19 11:25

zencart首页显示产品描述:
modules.zip
(7.8 KiB) 被下载 681 次

把上面的文件覆盖到相应文件上,首页就会有产品描述。

首页显示“Add to Cart”下载地址:
Add to Cart Buttons:http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1548
首页显示“Buy Now”下载地址:
add buy now button in main page products:http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1440
头像
xiao_min
VIP会员
VIP会员
 
帖子: 355
注册: 2010-06-08 11:17

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子agogo_2009 » 2010-10-23 11:20

$products_price = zen_get_products_display_price($new_products->fields['products_id']);
if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);


and replace with

$products_price = zen_get_products_display_price($new_products->fields['products_id']);
$products_desc = substr(strip_tags(trim(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))),0,100).'&hellip;';
$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 /');
if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);
$list_box_contents[$row][$col] = array('params' =>'class="back"' . ' ' . 'style="width:' . $col_width .'%;">'.$buy_now_link,
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">'.zen_image(DIR_WS_IMAGES .$new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a></div><p>') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a></p>'. $products_price);
为什么用这段代码替换后,实现buy now这个功能,但出现图标随意位置,而不是在图片和文字价格下方,请求JACK帮忙看下
agogo_2009
中级会员
中级会员
 
帖子: 68
注册: 2010-09-29 6:59
地址: http://www.uggbootss.ca
QQ 帐号: 604443273

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子xiao_min » 2010-10-23 11:30

agogo_2009 写道:$products_price = zen_get_products_display_price($new_products->fields['products_id']);
if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);


and replace with

$products_price = zen_get_products_display_price($new_products->fields['products_id']);
$products_desc = substr(strip_tags(trim(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))),0,100).'&hellip;';
$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 /');
if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);
$list_box_contents[$row][$col] = array('params' =>'class="back"' . ' ' . 'style="width:' . $col_width .'%;">'.$buy_now_link,
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">'.zen_image(DIR_WS_IMAGES .$new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a></div><p>') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a></p>'. $products_price);
为什么用这段代码替换后,实现buy now这个功能,但出现图标随意位置,而不是在图片和文字价格下方,请求JACK帮忙看下

这个的话你改下css代码试试
头像
xiao_min
VIP会员
VIP会员
 
帖子: 355
注册: 2010-06-08 11:17

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子fish1449 » 2010-11-04 17:51

支持一个 收藏了 首页add to cart按钮之前困扰了我好久。。
fish1449
新手上路
新手上路
 
帖子: 12
注册: 2010-07-27 11:29
QQ 帐号: 122600041

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子agogo_2009 » 2010-11-05 2:24

还是解决不料图标随便出现
agogo_2009
中级会员
中级会员
 
帖子: 68
注册: 2010-09-29 6:59
地址: http://www.uggbootss.ca
QQ 帐号: 604443273

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子fcl0534 » 2011-03-16 22:50

做个记号,也许以后会用
fcl0534
普通会员
普通会员
 
帖子: 26
注册: 2011-03-02 23:40

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子其路悠悠 » 2011-07-02 18:04

mark
其路悠悠
中级会员
中级会员
 
帖子: 66
注册: 2011-06-08 14:25

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子ganxin » 2011-08-05 9:31

记号
ganxin
中级会员
中级会员
 
帖子: 56
注册: 2009-11-28 20:14

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子zhjhqk » 2011-08-13 11:40

mark
zhjhqk
VIP会员
VIP会员
 
帖子: 396
注册: 2010-09-21 10:16

Re: zencart首页显示产品描述、“Add to Cart”和“buy now”

帖子xiao_min » 2011-08-31 14:51

描述&buynow.zip
(7.24 KiB) 被下载 438 次

覆盖到includes/modules/你的模板名
效果.jpg
效果.jpg (30.95 KiB) 被浏览 6734 次
头像
xiao_min
VIP会员
VIP会员
 
帖子: 355
注册: 2010-06-08 11:17

下一页

  • 相关话题
    回复总数
    阅读次数
    最新文章

回到 精华共享



在线用户

正在浏览此版面的用户:没有注册用户 和 0 位游客