I added a PHP code snippet to my store, but I have the following problem:
The code show the currency symbol and the amount like this “You save: $20”, but in my country the currency symbol is over the number like this “You save: 20 PLN”.
Just need to replace the value of this code, but I don’t know how. I tried everything without success.
<p class="you_save_price">You save: <?php echo $currency_symbol .''. number_format($saved_amount, 2, '.', ''); ?></p>
<?php
}
I try to change the position, but it doesn’t work… It throws a syntax error.
How to replace the price amount position and the currency symbol?
2
Answers
The issue is resolved, thank you so much
Simply use WooCommerce dedicated
wc_price()
function instead, like:or even better:
Both should work as expected.
Note: The WooCommerce price formatting function wc_price() uses your shop formatting price and currency settings and handle multicurrency when enabled by an additional plugin.