Log in
Factory

TotalFactory

Magento\Sales\Model\Order\TotalFactory

What it does

This factory class creates instances of order total calculation classes that extend AbstractTotal.

Developers use it when they need to dynamically instantiate different total calculation implementations (like tax, shipping, discounts) based on runtime conditions, allowing flexible creation of various total calculator objects without hardcoding specific class names.

Public Methods

  • create()