put currency sign in front and change numbers to integer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
put currency sign in front and change numbers to integer
Hello,
We are using Aimeos version 20.10.1 on a Typo3 v.9.5.21 with php 7.3.19-1~deb10u1 and managed to put some products in. However, for the currency we are using (Chilean Peso) it is required that the currency nominator "$" is in front of the price instead behind the price. Also, we would like to eradicate the decimals and only put the price in integers.
Right now, a price for a product is shown like this: 3.500,00 $
We would like the price be shown like this: $ 3.500
How could we achieve this?
We have found some old questions:
post3191.html#p3191
help-f15/price-format-t3221.html
, but cannot figure out where Locale.php is located in typo3conf/ext/aimeos in order to change at least the decimals from 2 to zero.
Also how to change the currency sign from behind the price numbers to in front of the price numbers provides a challenge for us.
Any hint appreciated.
We are using Aimeos version 20.10.1 on a Typo3 v.9.5.21 with php 7.3.19-1~deb10u1 and managed to put some products in. However, for the currency we are using (Chilean Peso) it is required that the currency nominator "$" is in front of the price instead behind the price. Also, we would like to eradicate the decimals and only put the price in integers.
Right now, a price for a product is shown like this: 3.500,00 $
We would like the price be shown like this: $ 3.500
How could we achieve this?
We have found some old questions:
post3191.html#p3191
help-f15/price-format-t3221.html
, but cannot figure out where Locale.php is located in typo3conf/ext/aimeos in order to change at least the decimals from 2 to zero.
Also how to change the currency sign from behind the price numbers to in front of the price numbers provides a challenge for us.
Any hint appreciated.
aimeos 20.10.4 with aimeos_dist 20.10.1 on Typo3 10.4.12 with php 7.3.19-1 ~ deb10u1
Re: put currency sign in front and change numbers to integer
The precision of the price values can be changed using "mshop/price/precision", i.e.:
The format of the prices is determined by a string that can be translated:
https://aimeos.org/docs/latest/typo3/cu ... anslations
Here's the code that makes the translation:
https://github.com/aimeos/ai-client-htm ... rd.php#L55
Use client as translation domain %1$s %2$s as string and %2$s %1$s as translation. Then, the currency sign and value is swapped.
Make sure you add this also to the scheduler tasks so it will be used for the sent emails too
Code: Select all
plugin.tx_aimeos.settings.mshop.price.precision = 0
https://aimeos.org/docs/latest/typo3/cu ... anslations
Here's the code that makes the translation:
https://github.com/aimeos/ai-client-htm ... rd.php#L55
Use client as translation domain %1$s %2$s as string and %2$s %1$s as translation. Then, the currency sign and value is swapped.
Make sure you add this also to the scheduler tasks so it will be used for the sent emails too
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: put currency sign in front and change numbers to integer
Thank you very much for the swift answer. I have changed the decimals to 0 adding this to my templates TypoScript Setup:
But when I add the following, there is no change to the order as we want it ( currency first, price second) Could someone point out my error? The template analyzer did not show any abnormalities...
Have a good day!
Code: Select all
# set the precision of price values to integer values using mshop.price.precision
plugin.tx_aimeos.settings.mshop.price.precision = 0
Code: Select all
# swapping the currency sign with the price value
plugin.tx_aimeos.settings.i18n.es.0 {
domain = client
string = %1$s %2$s
trans = %2$s %1$s
}
aimeos 20.10.4 with aimeos_dist 20.10.1 on Typo3 10.4.12 with php 7.3.19-1 ~ deb10u1
Re: put currency sign in front and change numbers to integer
Can you try this instead:
Code: Select all
plugin.tx_aimeos.settings.i18n.es.0 {
domain = client/code
string = price:default
trans = %2$s %1$s
}
https://github.com/aimeos/ai-client-htm ... rd.php#L55
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: put currency sign in front and change numbers to integer
Brilliant!
Success! Yes, this did the trick. I added the same snippet to our scheduler tasks. Thank you for your support!
Success! Yes, this did the trick. I added the same snippet to our scheduler tasks. Thank you for your support!
aimeos 20.10.4 with aimeos_dist 20.10.1 on Typo3 10.4.12 with php 7.3.19-1 ~ deb10u1