最新消息:觉得本站不错的话 记得收藏哦 博客内某些功能仅供测试 讨论群:135931704 快养不起小站了 各位有闲钱就打赏下把 My Email weicots#gmail.com Please replace # with @

magento购物车加减产品

Magento 资料整理 mingyue 5806浏览

 

版本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购物车加减产品

蜀ICP备15020253号-1