VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Setting up shipping methods for categories

Setting up shipping methods for categories 07 Oct 2017 03:56 #1

Hi,

Here is my rule

Shipping=2.5*evaluate_for_subcategories(Articles, 158) + 4*evaluate_for_subcategories(Articles, 159) + 6*evaluate_for_subcategories(Articles, 160) + 8*evaluate_for_subcategories(Articles, 161) + 15*evaluate_for_subcategories(Articles, 162) + 21*evaluate_for_subcategories(Articles, 163)
Name=Free Shipping above 100; 100<=Amount; 0

I want to have it so if you select more than 1 product from the same category an extra small cost is added. However the costs will be different for each category. How can i add this in?
The administrator has disabled public write access.

Setting up shipping methods for categories 07 Oct 2017 20:14 #2

Dear Gavner,
When you say that an extra small cost is added if there is more than 1 product, do you mean an extra small cost per additional unit, or a fixed extra cost (i.e. 2 copies cost more than 1, but 3 have the same shipping cost as 2)?

Your current rule charges 2.5€ for each copy from cateogry 158 (and it's subcategories). Do you want to change this so that only the first product from category 158 has 2.5€ shipping costs and each further article has a smaller shipping cost?

I don't think your use case can be easily implemented with our plugin.
One can, however, always explicitly go through all possible cases and store the shipping costs in a temporary variable. The following example charges 2.5€ for the first article from category 158, and 0.5€ for each further article from that category. For category 159 it charges 4€ for the first plus 0.5€ for each further article. I have not implemented the other categories in this example, as the two categories 158 and 159 should give you the idea how to handle all further categories:
Name=Free Shipping above 100; 100<=Amount; 0
Variable=myShipping; Value=0
Variable=myShipping; evaluate_for_subcategories(Articles, 158)>0; Value=myShipping + 2.5 + 0.5 *(evaluate_for_subcategories(Articles, 158)-1)
Variable=myShipping; evaluate_for_subcategories(Articles, 159)>0; Value=myShipping + 4 + 0.5 * (evaluate_for_subcategories(Articles, 159)-1)
[...]
Shipping=myShipping

Best regards,
Reinhold
The administrator has disabled public write access.

Setting up shipping methods for categories 08 Oct 2017 00:35 #3

This is exactly what i was looking for! Thank you
The administrator has disabled public write access.

[SOLVED] Setting up shipping methods for categories 02 Nov 2017 16:49 #4

Problem solved.
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular