How to manipulate prices / tax rules

28 views Asked by At

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.

I 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

{% 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) %}

This changes nothing.

Resources I'm following:

https://developer.shopware.com/docs/resources/references/app-reference/script-reference/cart-manipulation-script-services-reference.html#PriceFactory

https://developer.shopware.com/docs/resources/references/adr/2023-02-01-app-script-product-pricing.html

I'm using Shopware 6.5.1.0

0

There are 0 answers