从magento

时间:2016-11-29 07:27:44

标签: php jquery magento

<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(); ?>">

我有一张包含多件物品的购物卡 如何从购物卡中删除所选项目?

enter image description here

1 个答案:

答案 0 :(得分:0)

  

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