price without decimals

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
akropivko
Posts: 36
Joined: 20 Jan 2021, 12:49

price without decimals

Post by akropivko » 14 Feb 2021, 15:57

Hi!
Is there any way to configure in one place to use price without decimals? e.g. 1000 usd

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: price without decimals

Post by aimeos » 15 Feb 2021, 10:50

You can set the price precision using:

Code: Select all

mshop/price/manager/precision => 0
More info:
https://github.com/aimeos/aimeos-core/b ... #L183-L194

See also:
https://aimeos.org/docs/latest/laravel/ ... figuration
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

akropivko
Posts: 36
Joined: 20 Jan 2021, 12:49

Re: price without decimals

Post by akropivko » 16 Feb 2021, 14:22

Thanks!
A small note.
My version of aimeos-core/lib/mshoplib/src/MShop/Price/Manager/Standard.php has a little bit different config string:
$this->precision = $context->getConfig()->get( 'mshop/price/precision', 2 ); (not 'mshop/price/manager/precision'): see attach.

So when I update the core I will loose this config. Probably it would be good either do not change config strings in future versions or make some kind of compatibility.
Attachments
Screenshot_27.jpg
Screenshot_27.jpg (32.12 KiB) Viewed 1022 times

Post Reply