我在这里: 深圳seo » 〖ZEN-CART〗 » 浏览文章: 关于zencart的ADD TO CART的位置移动!
« zencart网站程序的基础知识zencart 网站建设+信用卡在线支付+SEO推广(8万套餐) »

关于zencart的ADD TO CART的位置移动!

paypal跳转

在王文学习zencart程序的时候,有很多疑问,例如刚做zencart站时,发现那个add to cart在产品详细描述的下面显示,而在产品的价格旁边却没有显示,于是就在zencart的中文论坛上到处找寻解决方法,今天终于解决了这个问题:

问题1: 如何将产品详细页的add to cart 按钮移动到 产品的价格旁边?

修改tpl_product_info_display.php, 复制

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartAdd">
    <?php
      echo $display_qty;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->

然后粘贴到   <!--eof Product Price block -->   下面,就OK了。

问题2: 首页如何加add to cart的问题,解决办法:

new_products.php可以在$products_price);的);前加入:

. '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products->fields['products_id']) . '"><img src="images/buttons/button_buy_now.gif"></a>'

问题3 如何在zencart的商品列表页里显示add to cart按钮?

商店设置-商品列表:
显示添加到购物车按钮,设置为1
显示多个商品数量方框状态和设置按钮位置,设置为0


 


 

  • 相关文章

发表评论

为了防止SPAM,含链接的评论需要审核后才能显示。

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

www.51ctoall.cn