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 everyone, I recently stumbled over the fact that the net_price in the spy_sales_order_item is
Hello everyone,
I recently stumbled over the fact that the net_price in the spy_sales_order_item is 0 for every entry. I tried to follow the code and it seems that the net price is set to 0 in Spryker\Zed\PriceCartConnector\Business\Manager\PriceManager::setOriginUnitGrossPrice()
because of the GROSS_MODE and there doesn't seem to be a CalculationPlugin or something like that to recalculate the net price.
I have two questions regarding this:
1. What is the reason to set the net price hard coded to 0 when using the GROSS_MODE?
2. Now, to fix this, I thought about implementing a plugin that calculates the net price when GROSS_MODE is used, to have the correct value in the database, respectively. Is there maybe already a core solution to this problem that I've just missed?
Comments
-
Not fully answering the question (sorry in advance) but I think the behaviour is similar chosing the other way (NET_MODE), leading to empty gross prices. The datastructure is prepared to cover both, the data contained in the data is only actively maintained/calculated/stored for one. It’s a bit irritating…
I am not aware of a core plugin/feature keeping both prices in sync or similar
0 -
Thanks. That does actually help. 🙂
0 -
cool 🙂
0 -
that’s right, you can’t have both price types at the same time, since calculation needs to be done differently (https://documentation.spryker.com/docs/net-gross-prices-management)
Price mode, however, is defined on quote level, which means you can have carts in different modes.
Usually on the project you need to find out in which “mode” you are working0 -
From the calculator stack, I can see a NetTotalCalculatorPlugin that is added after the GrandTotal and calculates the total Net price as “grandTotal - taxTotal”
0 -
if you still need to calculate both prices for your project, I would add missing calculators or remove the ones that you find irrelevant for you
0 -
Great, thanks again. I was just wondering why the net price is always 0 in the database. It felt a bit strange to always calculate the net price (gross - tax) whenever the net price is required. But if that is intended I have a good basis for discussion and we can decide how we want to do it in the future.
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