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.

Shopware 5 - no shipping abroad for certain items

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

Shopware 5 - no shipping abroad for certain items

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.

Shopware 5 - no shipping abroad for certain items

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.

Shopware 5 - no shipping abroad for certain items

Step 4:

The applicable articles will now be adjusted.

Shopware 5 - no shipping abroad for certain items

Under free text fields there is now the new option "no delivery Switzerland", which can be selected if required.

Shopware 5 - no shipping abroad for certain items

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.

Shopware 5 - no shipping abroad for certain items

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

Privacy
I, René Kohl (c/o Grosch Postflex #2439) (place of residence: Germany), would like to process personal data with external services. This is not necessary for using the website, but allows me to interact even more closely with you. If desired, please make a selection:
Privacy
I, René Kohl (c/o Grosch Postflex #2439) (place of residence: Germany), would like to process personal data with external services. This is not necessary for using the website, but allows me to interact even more closely with you. If desired, please make a selection: