我想不加載與AJAX的幫助頁面即更新購物車中物品。 任何人都可以告訴我,我把這個代碼放在哪個文件中。UPDATE車中的物品使用Ajax在Magento
jQuery(document).ready(function(){
jQuery('#shopping-cart-table')
.on(
'change',
'input[name$="[qty]"]',
function(){
var form = jQuery(jQuery(this).closest('form'));
// we'll extract the action and method attributes out of the form
// kick off an ajax request using the form's action and method,
// with the form data as payload
jQuery.ajax({
url: form.attr('action'),
method: form.attr('method'),
data: form.serializeArray()
});
}
);
});
任何人都可以幫助我.. ???? –