2016-11-29 112 views
0
<script> 
    function getValueUsingClass(){ 
     /* declare an checkbox array */ 
     var chkArray = []; 

     /* look for all checkboes that have a class 'chk' attached to it and check if it was checked */ 
     $(".chk:checked").each(function() { 
      chkArray.push($(this).val()); 
     }); 

     /* we join the array separated by the comma */ 
     var selected; 
     selected = chkArray.join(',') + ","; 

     /* check if there is selected checkboxes, by default the length is 1 as it contains one single comma */ 
     if(selected.length > 1){ 
      alert("You have selected " + selected); 
     }else{ 
      alert("Please at least one of the checkbox"); 
     } 
    } 
</script> 

<input type="button" value="Remove Selected" id="buttonClass"> 
<input type="checkbox" class="chk" value="<?php echo $_item->getId(); ?>"> 

我有一个购物卡,里面有多个商品。
如何从我的购物卡中删除所选项目?从magento的购物车中删除所选商品

enter image description here

+2

而问题是什么? –

+0

@GerardRozsavolgyi我想他想从他的购物卡里删除选定的物品。 Yogesh,请提供一些你正在使用的代码。我们不是在这里为你写整个申请表,而是为了帮助你解决你遇到的问题。 所以提供代码,并解释什么是不工作的。 – Mitch

+0

我收到物品ID,但我无法删除购物车中的选定物品。请提供多个删除代码。 – yogesh

回答

0

enter image description here你为什么不使用这个插件 Multiple Items Delete (Shopping Cart)

+0

现在我使用这个插件,但我在购物车页面出现一些错误 – yogesh

+0

你能告诉我那些错误吗? – 2016-11-29 12:14:25

+0

请参阅此链接[https://i.stack.imgur.com/bk3oa.png]复选框不显示在删除列 – yogesh

相关问题