2016-11-29 9 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(); ?>"> 

私はショッピングカードに複数の商品が入っています。
ショッピングカードから選択したアイテムを削除するにはどうすればよいですか?ショッピングカートから選択した商品をマジェンタで取り除く

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

これらのエラーを表示できますか? –

+0

このリンク[https://i.stack.imgur.com/bk3oa.png]を参照してください。削除欄にチェックボックスが表示されない – yogesh

関連する問題