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 together, has any of you seen this kind of behaviour? There are several prices per store for t

U016ZPC5480
U016ZPC5480 Posts: 24 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello together, has any of you seen this kind of behaviour? There are several prices per store for the same product. Is the unique check done by price_data_checksum?

Comments

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    price_data_checksum is only for price_data column.

    It's possible to have not unique prices in this table, because main table for default product prices is spy_price_product_default which has reference to spy_price_product_store

  • U016ZPC5480
    U016ZPC5480 Posts: 24 πŸ§‘πŸ»β€πŸš€ - Cadet

    And how does spy_price_product_default now, which price is the default for a specific store?

    In that example i would have multiple prices per store and multiple stores. But only one default price for alle stores. Or am i wrong?

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    At the end the SQL query will be like this:

    SELECT * FROM spy_price_product_store pps INNER JOIN spy_price_product_default ppd ON pps.id_price_product_store = [ppd.fk](http://ppd.fk)_price_product_store WHERE ... store, type, gross/net ... conditions

  • U016ZPC5480
    U016ZPC5480 Posts: 24 πŸ§‘πŸ»β€πŸš€ - Cadet

    Sorry, I still don’t understand that.

    The default table has the product id and the id of the default price.

    There are, for example, 12 prices distributed over 3 stores, a total of 4 prices per store.

    But the default price is only valid for store number 1. It’s the exact id of that price_product_store row, which contains the specific store id.

    How can I then determine via a join which price is relevant for store 2, 3 or 4?

  • U016ZPC5480
    U016ZPC5480 Posts: 24 πŸ§‘πŸ»β€πŸš€ - Cadet

    Shouldn’t there be a match for each store in the spy_price_product_default table?

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet