Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Shipping by Rules for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • gavner
  • gavner's Avatar Topic Author
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?

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

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

  • gavner
  • gavner's Avatar Topic Author
This is exactly what i was looking for! Thank you

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

Problem solved.
  • Page:
  • 1