This time we had the following problem with Shopware 5. In Switzerland, trademark protection regulations mean that we are not allowed to ship a certain manufacturer there.
But how do we solve it elegantly without having to send the customer a rejection?
We decided on the following solution, which I found in the Shopware forum.
Step 1:
A free text field is declared first. In our case we used attr4.
Column type would be Checkbox - INT(1). We named the label "No delivery Switzerland" and activated the option Show in the backend.
Step 2:
Under Basic settings - Storefront - Shipping costs module, the extended SQL query is supplemented with MAX(at.attr4) AS switzerland.
MAX(a.topseller) as has_topseller, MAX(at.attr3) as has_comment, MAX(b.esdarticle) as has_esd, MAX(at.attr4) AS switzerland
Step 3:
In the corresponding shipping costs under advanced settings, add the following custom condition:
!Switzerland
That says, if this condition applies, then this shipping method will be excluded. Of course, this also works the other way around if the exclamation mark is omitted.
Next, we created a new shipping method and called it "no delivery to Switzerland". The description could go something like this:
Due to trademark protection regulations, the ordered items (or parts of them) may not be delivered to Switzerland.
Step 4:
The applicable articles will now be adjusted.
Under free text fields there is now the new option "no delivery Switzerland", which can be selected if required.
Step 5:
When a test order is run through, the shipping method that has just been created appears in the order process for the customer and thus immediately has the information that no delivery will be made to Switzerland.
Sources
https://forum.shopware.com/t/versand-bestimmter-artikel-ins-ausland-verbieten/38926
3d rendering of online shopping in switzerland for social media and websites from @aacystudio
Passionate "phone clipper". Currently with mine Samsung Galaxy S22 Ultra. A great phone with XNUMX TB of storage. Lots of space for experiments. My favorite subjects are plants, Eat & drink, animals, Buildings and Landscapes.
Otherwise, I like to spend my time in nature and sometimes hang out on the PC, with a cozy round Civ or Star Citizen, away. A series is also often sought after on the couch in the evening.