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. Any idea to delete a cart completely (and creating a new one afterwards) without accessing th

UPWG9AYH2
UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

Hello. Any idea to delete a cart completely (and creating a new one afterwards) without accessing the db directly? The customer can just have one cart, so adding another is not possible. Also deleting the cart is therefore not possible because there must be at least one cart. The background to this question: We changed the tax rate from 7% to 5% in spryker backend. However, when we add an item to the cart, the carts calculation object still responds with the old 7% which leads for all products to a compeltely wrong calculation … i guess that the taxrate is saved along the quote json in the db and was not changed when we changed the tax rate in backend … so, how to remove it from there without making any direct database access? any other ideas?

Comments

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    okay, following this https://documentation.spryker.com/docs/howto-get-ready-for-vat-tax-changes-in-germany there shouldnt be any taxrate saved along a quote … so i dont know why the calculation still is pulling 7% instead of 5% in backend

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    So how get the tax rate mapped to the product? In the product there is just “Increased tax for example” and there is a tax set for “Germany” which is then 19% for example … but the store name differs completely … how get the tax selected?

  • Hi @UPWG9AYH2! Just taking a look on the db (haven’t check the code itself, so, maybe you can get more info there) the tax is related to the country and not related to the store (directly) on the spy_tax_rate and then the relation with the tax set is stored on spy_tax_set_tax and the relation between the tax set and the product is on spy_tax_product_storage

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    But which country? The country of the customer?

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    Or is there a country to set when creating the cart?

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    Ok, i think we detected the problem and found a workaround but we still need some clarification why is it how it is for the future

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Please post the problem and the workaround so I could clarify internally then. 🙂

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    So in the backend for a customers address there is a field country which holds options that are configured in the store.php … since we have no restrictions for countries of our customer, we included a huge array with all possible country codes in the store.php … now we found out, that there is a kind of default behaviour for taxes in spryker, so “default is the first entry” of this array which leads for the tax calculation to an error because it is AC “Ascendia island”. So no matter what taxes we choose in the tax settings, it will allways match to the taxes set in the country code AC, even if the customer has set the country “DE” … so now we would like to know, how this is working and we can set that properly. Thanks a lot and have a nice weekend

  • Thomas Lehner
    Thomas Lehner Support Engineer @ Spryker Posts: 289 🏛 - Council (mod)

    @UPWG9AYH2 just to give you a small update on this one. We have forwarded it to the internal subject matter expert for this topic. I will keep you up to date.

  • Thomas Lehner
    Thomas Lehner Support Engineer @ Spryker Posts: 289 🏛 - Council (mod)

    Hey @UPWG9AYH2 if i try to reproduce your setup (i.e. include additonal countries in stores.php), set up a different tax for them and then assign the tax in the tax sets for my products everything is calculated correctly. The Tax for the country i select is correctly applied. Am i missing something?

  • UMVENKCBF
    UMVENKCBF Posts: 38 🧑🏻‍🚀 - Cadet

    Any news here?

  • Thomas Lehner
    Thomas Lehner Support Engineer @ Spryker Posts: 289 🏛 - Council (mod)

    I could not reproduce the problem. @UMVENKCBF do you have this suspected problem with the tax calculation, as well?