Breaking Changes - Twig Filters
We didn’t have any documentation around our price Twig filters, but in case they were being used, these are the breaking changes we’re introducing in combination with the Money resource changes.
Breaking - Expected 02/27/2024
- Removing
display_price. No longer needed withformattedbeing provided on anyMoneyproperty.{{ item|display_price }} => {{ item.price.regular_low.formatted }} - Removing
variation_display_price. No longer needed withformattedbeing provided on anyMoneyproperty.{{ variation|variation_display_price }} => {{ variation.price.regular.formatted }} - Removing
variation_prices. It only provided the regular prices which could cause confusion with sale prices.{{item|variation_prices}} => {% set variationPrices = {} %} {% for variation in item.variations %} {% set variationPrices = variationPrices|merge({ (variation.id): variation.price.regular.amount }) %} {% endfor %} - Updating
format_priceto use the subunits amount (amountonMoney) instead of the float value. Docs to be added for this filter after the breaking resource changes are released.{{ item.price.regular_low|format_price({ currency: item.price.currency }) }} => {{ item.price.regular_low.amount|format_price({ currency: item.price.regular_low.currency }) }}