Delivery according to post code and product type

Hi,

I’m tryin to configure the delivery in a shop, I would need to set it up according to an alphanumeric post code plus the type of different products. I’ve done some tests and I manage to make it work but just for the first product added to the shopping cart, after that, the other products just duplicate the behaviour of this one.

So this is what I need, I add the product X to my shopping cart, the post code will be checked and the type of the product, if its category is ‘fresh’ the price will be 5, for each ‘fresh’ product I have to add 5 to my delivery cost. After this I add another product to my basket, but in this case the product it’s not ‘fresh’ so if the total amount of no ‘fresh’ products is less than 60 I have to add 3 to my delivery but just one time for all the non ‘fresh’ products.

Any idea? I have been checking this http://en.community.shopware.com/Individual-conditions-and-calculations-for-shipping-costs_detail_1941.html but the information it’s not enough. As I said I manage it to work but just for the first product added to my shopping cart

thanks

Hello,

basically you should be able to implement your needed logic with the individual calculation in the shipping cost.

My advise would be to definitely mark the ‚fresh‘ products with a free text field of the type checkbox.

This can be checked much easier than the category of the item because one item can have multiple categories and subcategories and so on.

So for your fresh logic a calculation like this should work, you maybe would have to edit what should happen if the not freh items are more than 60(currenlty I just add 0):

SUM(IF(at.attr8=1,5*b.quantity,0))+IF(SUM(IF(at.attr8<>1,b.quantity,0))<60 AND SUM(IF(at.attr8<>1,b.quantity,0))>=1,3,0)

Also you did not specify how the post code will be checked and what should happen for the different results of the check but maybe this calculation helps you develop your own calculations.

Greetings from Schöppingen
Janine

 

@JanineOverhausKocan schrieb:

Hello,

basically you should be able to implement your needed logic with the individual calculation in the shipping cost.

My advise would be to definitely mark the ‘fresh’ products with a free text field of the type checkbox.

This can be checked much easier than the category of the item because one item can have multiple categories and subcategories and so on.

So for your fresh logic a calculation like this should work, you maybe would have to edit what should happen if the not freh items are more than 60(currenlty I just add 0):

SUM(IF(at.attr8=1,5*b.quantity,0))+IF(SUM(IF(at.attr8<>1,b.quantity,0))<60 AND SUM(IF(at.attr8<>1,b.quantity,0))>=1,3,0)

Also you did not specify how the post code will be checked and what should happen for the different results of the check but maybe this calculation helps you develop your own calculations.

Greetings from Schöppingen
Janine

 

Hello Janine,

This absolutely did the trick, thank you so much, that advice is worth millions, with the free text fields is easy to get it working. Just a final question, I have this code:

CASE
    WHEN us.zipcode LIKE ‘CA%’ THEN SUM(IF(at.attr4=1,5*b.quantity,0))+IF(SUM(IF(at.attr4<>1,b.quantity,0))<60 AND SUM(IF(at.attr4<>1,b.quantity,0))>=1,3,0)

It’s working great except for the <60 part, having or not ‘fresh’ products on my shopping cart this condition it’s not triggered, and I’m not sure why. Sorted, I just add the price to that condition and now it’s working

 

Thank you very much!