0

I am creating new order from backend and i have to refresh order total section after my custom ajax request.

does any one know how i can achive this ?

enter image description here

2
  • 1
    You need to call the quote collect total method there same done on the shipping method selection or payment method selection. Commented Jun 18, 2021 at 10:00
  • Thank you @Dhiren Vasoya , i got the solution with reference of magento shipping method selection Commented Jun 18, 2021 at 11:01

1 Answer 1

3

With the help of below code i got my problem solution

 jQuery.ajax({
            url: url.build("/admin/router/controller/customfee"), 
            data: {option: 1},
            type: "POST", 
            dataType: 'json'
            }).done(
                 function (response) { 
                   window.order.loadArea(['custom_fee', 'totals'], true);
                 }   
               ).fail(
                    function (response) { 
                    }
                );
3
  • Can you help me how this loadArea work and send data to php function. Commented Feb 11, 2022 at 8:02
  • @SurajPrajapat Load area is not a data so we can not send it php but you can get "custom_fee" from quote in your js file and send to PHP via another Ajax Request Commented Feb 11, 2022 at 14:14
  • i am trying to change custom fee in total via ajax request but its not working. Commented Feb 11, 2022 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.