製品をバスケットに追加しようとしていますが、ユーザーが特定の選択入力からオプションを選択しない場合、ユーザーが [バスケットに追加] をクリックしたときに表示されるブートストラップ モーダル ウィンドウにその選択を表示したいと考えています。任意のオプションを選択します。その後、ユーザーはオプションを選択した場合にのみ続行します。これまでのコード:
$('#button-cart').bind('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, information, .error').remove();
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
$('#deleteMessage').modal();
$('.modal-body').after('<span class="error">' + json['error']['option'][i] + '</span>');
}
}
}
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#cart-total').html(json['totalProducts']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
}
});
});
それを行う方法についてのアイデアは大歓迎です! ありがとうございました!