Skip to content

Changelog

VatToggle

Every released version of VatToggle, newest first.

Storefront 6 releases latest 1.0.5Repository

Fixed

  • Separate the reverse proxy cache (e.g. Varnish) for gross and net by adding the VAT state to Shopware's sw-cache-hash cookie (TUULZ-2723). Guests with an empty cart now get that cookie as soon as they have toggled; Shopware alone only sets it for logged-in customers, filled carts or a non-default currency. The toggle request already responds with the new hash, so the following reload no longer hits the page cached for the previous state. Checkout and offcanvas cart responses now produce the same hash as the rest of the shop instead of one based on the checkout default, so they no longer hand a net customer the hash of the gross page, and opening the cart no longer causes an extra cache miss. The X-Tax-State response header is unchanged.

  • Stop a single request from putting the wrong tax state into the shared cache (TUULZ-2723). dmf-vat-state lasts a year, but sw-cache-hash only for the browser session, so after a restart a net guest sent the VAT cookie without a hash. Varnish keys on the hash the client sends, stored that net page under the key every guest without a hash shares, and served net prices to all of them; a hash sent without the VAT cookie did the same in reverse. Responses whose hash differs from the one the client sent are now no longer stored, the same check core runs behind its CACHE_REWORK flag, limited to requests with a VAT cookie or a hash. Shopware's own HTTP cache now also reads the VAT cookie for its cache key: it builds the key before the request is on the request stack, so the key part was always gross and returning net guests got the cached gross page. A returning net guest can still get the cached gross page from Varnish on the first page after a browser restart, until the cart widget request sets the hash again; only a VCL that also keys on dmf-vat-state avoids that.

Fixed

  • Derive the side labels' colours from the surrounding foreground instead of a fixed grey pair. .tax-switch-label was $gray-500 and .is-active $sw-text-color, which assumed every context the switch appears in has a light background — so on a top bar that another extension has recoloured, the active label stayed near-black on whatever colour was underneath it. The inactive label is now the context's colour at 55% and the active one takes it in full. The $tax-switch-label-color / $tax-switch-label-color-active variables are gone with them — nothing referenced them any more, and no theme configuration ever fed them. color-mix() has been available in all browsers Shopware 6.7 supports since 2023, so the labels carry no fallback declaration.

Fixed

  • Fix JSON body parsing in the toggle request and prevent double-click submissions (TUULZ-2712).

Fixed

  • Skip setting the VAT toggle cookie on checkout and offcanvas cart routes (TUULZ-2712).

Changed

  • Add blocks around toggle elements to allow storefront overrides (TUULZ-1628).

Added

  • Initial release

  • Gross/net VAT toggle for the Shopware 6 storefront

  • Server-side price rendering, cookie-based state, cache-separated for gross and net