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..
Can someone please tell me where is the price data for abstract products saved in the database?
Can someone please tell me where is the price data for abstract products saved in the database?
Comments
-
@U048WDEP3R7 It should be in the same table where the concretes' are stored too: in
spy_price_product_store
0 -
Unless you're looking for the storage tables, because those are separated by abstracts and concretes (
spy_price_product_abstract_storage
andspy_price_product_concrete_storage
). But the base price data should be in the aforementioned one, together for both abstracts and concretes.0 -
@U04FXCTCWPP I am on B2B store. Are they same on B2B as well?
0 -
@U048WDEP3R7 Should be, as I'm on a B2B store too and I see said tables in my store.
0 -
@U04FXCTCWPP Basically I am working on a custom product import. To add prices for abstract product, I am updating
spy_price_product
andspy_price_product_store
. But I still can not see the prices in backoffice in the "Price & Tax" section when editing an Abstract product. Can you please tell me if there is something else I need to do?0 -
@U048WDEP3R7 And do your abstract products really do have prices of their own in the import data source? Because as I know, abstract products don't necessarily need to have a price, only concretes. Maybe your abstract products don't have any price data to begin with?
Also, I assume you checked that your import really did update the price data in the DB? If yes, then you might also try to debug the code when opening the "Price & Tax" tab in the backoffice (or the product detail page in the shop) and see what data it gets from where and how - and this way you'll be sure to find the source of the problem.
0 -
@U04FXCTCWPP Actually, I am manually added the abstract price data. Something like this:
$this->setDataSetWriterPersistenceState(false); // todo try to initiate the following import sequences with chain of command pattern // adding/updating abstract product $spyAbstractProductId = $this->createOrUpdateProductAbstract($dataSet); // adding price // todo move it to a separate function $spyPriceProduct = new SpyPriceProduct(); $spyPriceProduct->setFkPriceType(1); $spyPriceProduct->setFkProductAbstract($spyAbstractProductId); $spyPriceProduct->save(); $spyPriceProductId = $spyPriceProduct->getIdPriceProduct(); $spyPriceProductStore = new SpyPriceProductStore(); $spyPriceProductStore->setFkCurrency(93); $spyPriceProductStore->setFkPriceProduct($spyPriceProductId); $spyPriceProductStore->setFkStore(1); $spyPriceProductStore->setGrossPrice(9002); $spyPriceProductStore->save(); // adding/updating localized product abstract $this->createOrUpdateProductAbstractLocalizedAttributes($dataSet, $spyAbstractProductId);
Just trying to figure out how can I show up the prices in the backoffice like this. So it seems like there is another schema that also needs to be updated.
0 -
@U048WDEP3R7 And did you check that these values were indeed added to your DB?
0 -
@U04FXCTCWPP Yes I checked. They are being added.
0 -
@U04FXCTCWPP Here are the relevant screenshots
0 -
That's probably not the problem, but you really should add a net price data too.
0 -
Other than that, looks good to me so far. As I said above, you really should check with a debugger to see what is happening when the backoffice (or the store) tries to get the price for the product. Then you could see immediately what the problem is.
0 -
Sometimes it happens that errors get "swallowed" by try/catches deep in the code and you don't even notice them unless you step it through with the debugger.
0 -
@U04FXCTCWPP thanks. I will try to debug it now π
0 -
yw π
0 -
@U048WDEP3R7 I checked a bit further and I think you're missing a connection in the spy_price_product_default table
0 -
@U04FXCTCWPP Unfortunately, I did that as well but still doesnt work
0 -
Hmm... do you also have the DEFAULT and the ORIGINAL entries in the spy_price_type table?
0 -
also, what you have in your spy_price_product_default table is wrong
0 -
because the fk you have there is not the same as the id in your price_product_store table
0 -
There, you have 7711, and here you have 959
0 -
@U048WDEP3R7 I think this latter mismatch will be your problem. Try updating that 959 fk value to 7711 in your spy_price_product_default table.
0 -
@U04FXCTCWPP WOW that was the issue. I missed it. Thank you very much for pointing that out.
0 -
yw π
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