<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(); ?>">
私はショッピングカードに複数の商品が入っています。
ショッピングカードから選択したアイテムを削除するにはどうすればよいですか?ショッピングカートから選択した商品をマジェンタで取り除く
を使用せず、質問はありますか? –
@GerardRozsavolgyi彼はショッピングカードから選択したアイテムを削除したいと思う。 Yogesh、使用しているコードを入力してください。私たちはあなたのためにアプリケーション全体を書いているのではなく、あなたが取り組んでいるものを手伝っています。 コードを提供し、何が動作していないかを説明してください。 – Mitch
アイテムIDを取得しましたが、カート内の選択したアイテムを削除できません。複数の削除コードを入力してください。 – yogesh