Calling Developers!
We are reenergizing our code contribution process! Learn More

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..

I added 4 price types but in Redis only one shows up in Redis..any ideas where I can look into to fi

Options
U01LE4BMBK7
U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet

I added 4 price types but in Redis only one shows up in Redis..any ideas where I can look into to figure out why it ignores the others? Currently trying to get the debugger to run through Spryker\Zed\PriceProductStorage\Business\Storage\PriceProductConcreteStorageWriter.

Comments

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    How am I supposed to show another price if it doesn't get exported to Redis?

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    Options

    Hey Philipp, you may be confusing a bit *price types* (like default / original) with *price dimensions (*_https://documentation.spryker.com/docs/priceproduct-module-details-reference-information#price-dimension)_ which is another concept. *Price type* in your case is all part of the *default price dimension*

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    edited September 2021
    Options

    So inside of your default price dimension you should be able to see prices of a different types. The data structure is like

    prices:
    dimension: // e.g. “default”, “merchant_relation” …
    currency: // e.g. CHF, EUR
    mode: // e.g. GROSS / NET
    type => money_value // e.g. ORIGINAL, DEFAULT => 100
    ….

    you should be able to see that in the actual price_product_(abstract/concrete)* redis entries

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    oooh....thanks you so much @UKJSE6T47 for clarifying this

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    There doesn't seem to be a way to store multiple prices in spy_price_product for one concrete product without using price types

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    neither in spy_price_product_store (we just have one store and one currency)

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    Options

    what’s your business use case?

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    we have one store that ships to two countries: Austria & Germany
    Customers can be B2B or B2C.
    Tax rates are:
    Austria B2B: 20% but some products having 0% because of special tariff numbers that are tax exempt
    Austria B2C: 20%
    Germany B2B: 0%
    Germany B2C: 19%

    I want to store those prices somewhere

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    I did get it running with 4 different price types and storing them in the default price table too

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    edited September 2021
    Options

    So, for your use-case, if you get the GROSS price mode (with tax already included) - I would suggest to go with the following approach:
    1. DE - B2C - use DEFAULT price, which is price with 19%
    2. DE - B2B - introduce a merchant relation with dedicated price of 0% (https://documentation.spryker.com/2021080/docs/merchant-custom-prices-feature-overview) - then you would need to assign this relation with all business units of all companies in DE. Later on, for companies with diff % you will be able to create other relations;
    3. AT - B2C - use DEFAULT price with 20% included. You don’t need for now any merchant relations since prices there are the same. Products with 0% will just have their price as-is in DEFAULT, too.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    Options

    In case you have NET mode and you have to calculate taxes on your own - I would need to ask internally if you can do diff taxes per b2c or b2b users..

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    Options

    In case you get NET prices and need to caclulate / add tax information on your own (based on 20% or whatever) - you could include that logic into the *cart calculation stack* (see CalculationDependencyProvider) and implement your custom logic there - you can have all the context you need - customer, store. So you can query the right % from DB. In that case you can go with
    1. DE - DEFAULT NET prices
    2. AT - DEFAULT NET prices
    3. you need to change the way taxes are stored. We have it per country, but not for b2c/b2b customers.

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    @UKJSE6T47 Thanks a lot for taking the time to come up with a solution

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    the issue with using merchant prices is that the tax calculation needs to be adapted too

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 🧑🏻‍🚀 - Cadet
    Options

    I got things running with several price types - just one small issue left where the shipping costs are grown in gross mode because it just takes the gross price that got calculated with a 20% tax and doesn't get recalculated for Germany's 19% vat