0

When I update my qty page reload I am using this code qty update but when I refresh page

 /* here is mu code */
  jQuery(document).ready(function(){
   jQuery('.btn-update').on('click',
    function(e){
      e.preventDefault();


        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()


        });


    }
);
});
  • If you want to see the qty update without reloading the page, you need to increment/update the value on the html element too – DependencyHell Dec 13 '18 at 10:49
  • how can i do that i am not aware of it – hemangi Dec 13 '18 at 11:17
  • using javascript, see example : jsfiddle.net/uewv81Ld - you can add a bit of js code in your existing code to update the right element – DependencyHell Dec 13 '18 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.