Hello All,
I am getting this error in the discount section on the mini cart page when I add the product in my cart. Instead of displaying the calculated discount, my store cart throws this error: " I18n Error: Missing interpolation value "savings" for "You're saving {{ savings }}" ". I got this error after creating rule for Automated Discount from shopify admin store. Please check the attached screenshot for the detail issue.
Can you please provide any solution to get fix my issue on the ajax cart.
Please suggest me with the solution to getting fix my issue.
Thanks in advance!
You can try looking for the code in your theme.js.liquid file:
totalCartDiscount: cart.total_discount === 0 ? 0 : {{ 'cart.general.savings_html' | t: price: '[savings]' | json }}.replace('[savings]', theme.Currency.formatMoney(cart.total_discount, settings.moneyFormat))
and change the t: price: to t: savings:
Make sure to test it out with a demo promotion to ensure the savings are the correct amount.
My theme.js looks a little different, any insight in how to modify this. Thanks
// Gather all cart data and add to DOM data = { items: items, note: cart.note, totalPrice: theme.Currency.formatMoney( cart.total_price, settings.moneyFormat ), totalCartDiscount: cart.total_discount === 0 ? 0 : theme.strings.cartSavings.replace( '[savings]', theme.Currency.formatMoney( cart.total_discount, settings.moneyFormat ) ) };
Hi there,
So on newer version of Brooklyn that have this error you need to locate this in the theme.liquid file, and similarly change
cartSavings: {{ 'cart.general.savings_html' | t: price: '[savings]' | json }}
to
cartSavings: {{ 'cart.general.savings_html' | t: savings: '[savings]' | json }}
Sorry to bring this up but I have been searching everywhere and none of the answers to solve this are available in my theme. We are using Digital world and in the theme.liquid there is no cartSavings. It must be somewhere else but I can't seem to find it. If you have any ideas I would greatly appreciate it. I know it is for adding the discount but can't solve this issue and its hurting our purchasing
User | Count |
---|---|
16 | |
16 | |
13 | |
12 | |
11 |