douge3113 2018-09-12 09:47
浏览 45

自动更新购物车使用购物车页面Magento 2中的递增和递减按钮

I have included + and - to increment and decrement the quantity of a product in the cart page. Now i need to update it automatically without clicking the update shopping cart button. How can i do that? Kindly help me to fix this problem

  • 写回答

1条回答 默认 最新

  • doushi8599 2018-09-12 10:06
    关注

    Use jQuery ajax() Method ajax function tutorial

    <button type="button" name="button" id="button-minus"> - </button>
    <script>
    $(document).ready(function(){
       var count = 0;
       $("#button-minus").click(function(){
         if ( count > 0 ){
            $.ajax({url: "url here", success: function(result){
                $("#div").html(result);
                count--;
            }});
         }
      });
    });
    </script>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 有人能看一下我宿舍管理系统的报修功能该怎么改啊?链表那里总是越界
  • ¥15 cs loadimage运行不了,easyx也下了,没有用
  • ¥15 r包runway详细安装教程
  • ¥15 Html中读取Json文件中数据并制作表格
  • ¥15 谁有RH342练习环境
  • ¥15 STM32F407 DMA中断问题
  • ¥15 uniapp连接阿里云无法发布消息和订阅
  • ¥25 麦当劳点餐系统代码纠错
  • ¥15 轮班监督委员会问题。
  • ¥20 关于变压器的具体案例分析