App FAQ: How to manipulate prices / tax rules #3517
-
What kind of question do you have about the app system?I'm trying to follow several resources on how to manipulate the product price, take the real net price and add country specific tax percentage to it, to get the correct gross price. Or maybe I need to adjust the tax rules, but I'm not sure how to do that. Describe your question or feedbackI managed to integrate a country select box, without the user to be logged in, but I'm struggling to get any changes visible when manipulating the shown prices. This is test-code from my own script in scripts/product-pricing hook
This changes nothing. Resources I'm following: I'm using Shopware 6.5.1.0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @codixio, I looked at your problem. I'm sorry the documentation seems to be incorrect here, because:
The following code worked for me: {% foreach hook.products as product %}
{% do product.calculatedCheapestPrice.reset %}
{% do product.calculatedPrices.reset %}
{% set price = services.price.create({
'default': { 'gross': 24.00, 'net': 20.00}
}) %}
{% do product.calculatedPrice.change(price) %}
{% endforeach %} I will update the documentation, sorry for the trouble. 👋 |
Beta Was this translation helpful? Give feedback.
Hi @codixio,
I looked at your problem. I'm sorry the documentation seems to be incorrect here, because:
The following code worked for me:
I will update the documentation, sorry for the t…