On 7/16/2022 at 11:24 AM, 4you.software said:Hi.
Use JavaScript instead and capture the button click.
Eg:
$(document).ready(function() { prestashop.on('updateCart', function(e) { var deliverydate = document.getElementById('my-date-picker-value'); if (typeof(deliverydate) != 'undefined' && deliverydate != null) { if (deliverydate.value !== ''){ $.ajax({ type: "POST", url: '/modules/my-module/function/my-function.php', data:'idCart='+this.cart.id+'&deliveryDate='+deliverydate.value, cache: false, ajax: false, success: function(data){ if (data !== ''){ console.log('done'); } } }); } } }); });
Hi, Thank you very much for your answer which already helps me a lot, however I don't know where to put this ajax script, in the tpl of the form, in the partial tpl included in the forms and in which the submit is located, or in ps_shoppingcart.js?
Could you explain me a little more the process ? I am a novice in JS...