What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello, does Spryker have a standard "price quantity" feature? For example, measurement, stock etc.
Hello,
does Spryker have a standard "price quantity" feature?
For example, measurement, stock etc. is per "piece".
But I have an price for example: 12,34 per 100 pieces.
I can't calculate it down during import, because I can save only 2 decimal places in Spryker (12,34 / 0,1234 per piece).
Comments
-
If I understood your case correctly, this is something that may fit here - https://docs.spryker.com/docs/scos/user/features/202108.0/prices-feature-overview/volume-prices-overview.html.
0 -
I hope I didn't miss something, but Volume Prices lowers the price when I order more pieces. But the price is still per piece. But for products, which have a very low price, the price is often defined as "price x per 100 pieces" or "price x per 1000 pieces". The formula would be:
price_per_piece = price_in_database / price_quantity
In the above example, the price per piece would be 0,1234 which I can't save because it would lead to rounding problems in many software (as well in Spryker because it saves all prices with only 2 decimal places).
0 -
Sorry then, please wait for someone else's feedback.
0 -
Spryker only supports integers on the smallest unit, in your case euro cents. Donβt see any way you will get more than 2 digits. Also affects your gross prices
0 -
That's why I have to save the price quantity with the price in the price_product db table and adapt the price display and price calculations. Because that's not so easy, I was hoping that Spryker has already a feature for that.
0 -
You can try to adjust the precision for the conversion here https://github.com/spryker/money/blob/master/src/Spryker/Shared/Money/Converter/DecimalToIntegerConverter.php#L17 and here: https://github.com/spryker/money/blob/master/src/Spryker/Shared/Money/Converter/IntegerToDecimalConverter.php#L17
That should give you more precision for very small amounts of monetary values.0 -
I didn't fully understand your initial conundrum but it sound like you should have a look at this: https://docs.spryker.com/docs/scos/user/features/202108.0/packaging-units-feature-overview.html
and this:
https://docs.spryker.com/docs/scos/user/features/202108.0/measurement-units-feature-overview.html0 -
@U01T075RRHD Thanks for your suggestions. I already took a look on packaging + measurement features, but unfortunately I have another use-case.
We already discussed internally about changing the decimal precision. But then this has an effect on every price which is already stored anywhere in the database/storage/elastic search, right? This means we'd have to re-import all data. I think this is problematic, because this project is already productive.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random