版本1.9.xx,修改文件default.phtml,路径app\design\frontend\rwd\weicot\template\checkout\default.phtml,找到<td class=”product-cart-actions” 把下面的内容修改为:
<button type="submit" onclick="redQtyone(<?php echo $_item->getId() ?>);">-</button> <input type="text" id="qtyPro<?php echo $_item->getId() ?>"? pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" title="<?php echo $this->__('Qty') ?>" class="input-text qty" maxlength="12" /> <button onclick="addQtyone(<?php echo $_item->getId() ?>);" type="submit">+</button> <!--<button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update'); ?>" class="button btn-update"><span><span><?php echo $this->__('Update'); ?></span></span> </button>--> <!--Js控制---> <script type="text/javascript"> function addQtyone(sum){ var qtyPro=$('qtyPro'+sum); qtyPro.value = parseInt(qtyPro.value)+1; } function redQtyone(sum){ var qtyPro=$('qtyPro'+sum); qtyPro.value = parseInt(qtyPro.value)-1; } </script>
以上有他处查询资料,实际操作可行。
转载请注明:(●--●) Hello.My Weicot » magento购物车加减产品