Breaking Changes
- Configuration: The checkbox "Active for logged in customers?" is replaced by the selection "Behavior for logged in customers". The update takes over the old setting per sales channel and removes it: checked => "Choice of the customer always applies", unchecked => "Customer group decides". New installations start with "Customer group on login, afterwards the customer can switch".
- Snippet keys: the old keys were swapped (taxswitch.general.net was "Private customer: gross"). They are replaced by unambiguous keys. If you changed these snippets, please move your changes:
- taxswitch.general.net ("Privatkunde: Brutto") => taxswitch.label.privateBusinessLong.gross
- taxswitch.general.gross ("Gewerbekunde: Netto") => taxswitch.label.privateBusinessLong.net
- taxswitch.general.grossShort => taxswitch.label.grossNet.gross
- taxswitch.general.netShort => taxswitch.label.grossNet.net
- taxswitch.popup.content (contained HTML buttons) => taxswitch.popup.text, taxswitch.popup.privateTitle, taxswitch.popup.privateSubtitle, taxswitch.popup.businessTitle, taxswitch.popup.businessSubtitle (no HTML in snippets anymore, the buttons are part of the template)
- taxswitch.popup.headline stays
- taxswitch.cookie.error => taxswitch.cookie.hintText, taxswitch.cookie.hintHeadline, taxswitch.cookie.allowAndSwitchNet, taxswitch.cookie.allowAndSwitchGross
- new: taxswitch.label.* (label styles, link texts), taxswitch.secondaryPrice.*
- Template blocks and files:
- removed: layout/header/actions/taxswitch-widget.html.twig (with the blocks layout_header_actions_taxswitch*), top bar, header and off-canvas now use component/taxswitch-switcher.twig
- component/taxswitch-switcher.twig takes the parameters style (dropdown, segmented, toggle, link) and position (the old parameter class still works as position). The links and labels of the segmented control are now elements (aria-pressed), the CSS class taxswitch-switcher-product-detail is now taxswitch-switcher-product.
- the popup and the cookie hint are rendered from component/taxswitch-popup.html.twig and component/taxswitch-cookie-hint.html.twig
- JavaScript: the CSS classes js-taxswitch-netto and js-taxswitch-brutto (compatibility for old snippets) are removed. Use the data attributes data-taxswitch-set-net / data-taxswitch-set-gross. Clicks are handled by event delegation, so they also work in content loaded later. window.taxswitch no longer contains popup.headline, popup.content and cookie.error.
- Colors: the hover color of the switch is no longer hard coded. Colors, radius and spacing come from CSS custom properties --taxswitch-*.
New
- New selection "Behavior for logged in customers": "Customer group decides", "Customer group on login, afterwards the customer can switch", "Choice of the customer always applies" or "Choice of the customer, saved in the customer account" (restored on every device at the next login). Visitors who register (as a guest or with an account, e.g. in the checkout) keep their choice. The customer group only applies to a later login.
- "Show switch only for these customer groups"
- "Request customer group for business registrations" (also for guest orders)
- "Cookie lifetime in days" and "Popup test mode"
- The cookie hint has a button "Allow cookie and switch to net/gross" (consent only for this cookie), the link to the cookie settings stays
- URL parameter ?tax=net / ?tax=gross (setting "Allow URL parameter ?tax=net / ?tax=gross"): sets the cookie (with consent or technical cookie) and redirects to the URL without the parameter. Without consent the cookie hint opens with the target mode. Pages with the parameter are not cached and get X-Robots-Tag: noindex, nofollow.
- The popup waits for the cookie banner (third-party cookie managers can hook in, see the comment in the plugin JS). New: "Show popup only on these page types" and "Popup delay in seconds"
- The configuration is split into clear cards (General, Logged in customers, Registration, Popup, one card per position, Labels, Second price, Tracking)
- "Popup and cookie banner": wait until the banner is answered (default), open immediately, or wait for the banner and open after X seconds if it was ignored
- The popup cards show the cookie hint with the button "Allow cookie and switch" instead of opening the cookie sidebar
- Appearance per position: dropdown, segmented control, switch or text link for top bar, header, product page, footer, off-canvas menu and cart (off-canvas cart and cart page, which reopens after switching)
- Label styles ("Gross / Net", "incl. / excl. VAT", "Private / Business", "Private customer: gross / Commercial customer: net") as default and per position, "Show the header switch on very small screens?"
- Popup with two cards (private / commercial customer), content from templates
- Accessibility: real buttons, aria-pressed / role="switch", keyboard, visible focus, focus and Escape in the modals
- Second price ("Show the price in the other tax mode": product page, listing or both, also for staggered prices). Strike prices are converted too, the "Position of the second price" is selectable (above or below the tax note), cards in the listing keep the same height, and in net mode the gross price is the stored price of the product (no rounding error of one cent)
- Tracking: the events taxswitch:change (DOM) and TaxSwitch_changed (emitter) fire on every change. With "Send the change to a tracking tool" the event also goes to the dataLayer (Google Tag Manager / GA4) or Matomo Tag Manager, the "Name of the tracking event" can be changed. It is only sent with the consent of the visitor ("Consent cookie for the tracking tool", default is the Google Analytics entry of Shopware, empty = always send)
- Dutch and French translations
- Additional Twig blocks in the templates, so they can be adjusted more easily
Fixed
- Only the cookie values 0 and 1 are valid. Other values no longer create endless HTTP cache variants.
- With the technical cookie the popup is no longer suppressed after the cookie banner was answered.
- Uninstalling without keeping the data now removes all settings of the plugin, also values of single sales channels (Shopware only removes the global values).
- Fixed a conflict with other plugins that decorate the TaxDetector (TypeError: Argument #1 must be of type TaxDetector)
- Fixed an issue where the HTML sanitizer removed relevant data from a snipped
- Error fixed: The search icon was no longer displayed in the header
- Optimisation of the code
- Compatibility with Shopware 6.7.0.0 established
- Fixed an issue where orders created in the admin were affected by the cookie
- Version split for Shopware 6.5 and 6.6 to fix problem with duplicate Dist-Js files
- Version split for Shopware 6.5 and 6.6 to fix problem with duplicate Dist-Js files
- HTML attribute added to modify the redirect URL
- Javascript optimized
- Customizability from third party plugins improved
- Compatibility with Shopware 6.6.0.0 established
- Removed not needed title-attribute
- Compatibility with Shopware 6.5.0.0 established
- Javascript optimised
- Removed PHP controller and moved logic to Javascript
- Compatibility with Shopware 6.4.18.0 established
- Compatibility with Shopware 6.4.13.0 established
- Added event TaxDetectorDecoratorUseGrossEvent
- added responseMode and setShowGross parameters to "/taxswitch/toggle" controller
- Compatibility with Shopware 6.4.11.1 established
- Fix bug in cookie permission modal
Add option to preselect the "I am" field
- Fix snippets (6.4.0.0 related)
- Fix wrong config in base.html.twig (6.4.0.0 related)
- Caching fixed (6.4.0.0 related)
- Use sw_extends instead of extends in twig templates
- Add switch to header (next to cart icon)
- Added button on product page (can be activated via configuration)
- Added switch in footer (can be activated via configuration)
- Bug fixed: Sitemap creation via CLI did not work
- CacheStore overwrite removed, the CacheKey is now added by event
- Added option to set the required cookie as a technical cookie (no user permission needed)
- Problem solved, that the switch can not be disabled in single storefronts
- Improve popup usability
Adjust required versions in composer.json for 6.2.0 compatibility
Note: Delete or deactivate the cache before the update
- Add config: Active/Inactive
- Allow to disable switcher for logged in customers
- Add PopUp (Modal/Lightbox) for first visit (configurable)
- Add button to open the cookie settings in info-modal if cookies are not accepted (Usability)
- Improve javascript (use shopware plugin system + replace alert with modal)
- Minor fixes in code
Release of the gross/net plugin.