You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commerce 1.x's function commerce_order_calculate_total() will always initialize a total price with $0 (defaulting to the default currency of the site in a case where there are no items on the order to say otherwise). Commerce 2.x uses NULL, which means you cannot blindly pass the total price field's value to Twig and render it with price formatting - that would result in NaN when the template is rendered. We should document this difference in the section:
Commerce 1.x's function
commerce_order_calculate_total()
will always initialize a total price with $0 (defaulting to the default currency of the site in a case where there are no items on the order to say otherwise). Commerce 2.x usesNULL
, which means you cannot blindly pass the total price field's value to Twig and render it with price formatting - that would result inNaN
when the template is rendered. We should document this difference in the section:https://docs.drupalcommerce.org/v2/developer-guide/adapting-from-1x/
The text was updated successfully, but these errors were encountered: