🔥 Just Launched! Werra Premium Template for HyväSee it in Action

Dynamically Reload Totals on Admin Create Order Page in Magento 2 Using JavaScript

By Sanjay JethvaUpdated on Jun 10, 2025 2 min read

Creating orders from the Magento 2 admin panel is one of the most commonly feature store admins use. As developers, there is a high need to customize or extend this functionality to meet specific business needs.

When building custom features, there’s a frequent need to update specific sections of the order creation page — such as totals, taxes, discounts, or shipping costs without refreshing the entire page.

Refreshing the entire page generally causes the below issues:

  • Adds unnecessary server load
  • Disrupts the admin’s workflow
  • Reduces the performance and user experience

That’s why reloading only the affected block is the best and recommended practice.

A dynamic reload totals on admin create order page in Magento 2 using JavaScript is needed in below cases:

  • The totals are recalculated
  • Shipping and tax rules are correctly applied
  • Discounts or custom changes reflect accurately
  • Refreshing totals display
  • Update any related UI elements

How to Dynamically Reload Totals on Admin Create Order Page in Magento 2 Using JavaScript?

Integrate the below solution in your js file to reload the total block on the admin create page.

window.order.loadArea(['specify_total_block_name', 'totals'], true);

Where window.order refers to a global JavaScript object provided by Magento’s admin UI (specifically in order creation/edit views).

Simply, use this solution to ensure data accuracy, better performance, and a smoother admin experience.

Reloading only the necessary sections like totals using JavaScript is always a smart approach when working with the admin order page in Magento 2.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.