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:

(NOT SOLVED) Shipping by weight, ZIP, and heavy products 30 Jun 2017 11:43 #1

  • sucolega
  • sucolega's Avatar Topic Author
Hi, I'm stuck and I need to achieve the following:
- Shipping cost by ZIP (Ok)
- Shipping cost by weight (Ok)
- If the order amount is more than 150€ free shipping (Ok)
- If the order amount is more than 150€ and there are heavy products (from various categories) then the shipping cost is only for the weight of this heavy products. (Help needed)

I'm using Virtuemart and Advanced Shipping by rules v6.2.2
This is what I have so far:

For the first ZIP Zone:

Definition=ZONA1; Value=ZIP2 in list("04", "18", "23", "29", "14", "41", "11", "21")
Definition=PESO1; Value=0
Definition=PESO1; Weight<5; Value=4.9174
Definition=PESO1; 5<=Weight<10; Value=5.7438
Definition=PESO1; 10<=Weight<15; Value=6.157
Definition=PESO1; 15<=Weight<20; Value=6.9835
Definition=PESO1; 20<=Weight<30; Value=8.6364
Definition=PESO1; 30<=Weight<40; Value=10.2893
Definition=PESO1; 40<=Weight<50; Value=11.9421
Definition=PESO1; 50<=Weight<60; Value=14.4215
Definition=PESO1; 60<=Weight<70; Value=16.4876
Definition=PESO1; 70<=Weight<80; Value=18.9669
Definition=PESO1; 80<=Weight<90; Value=21.4463
Definition=PESO1; 90<=Weight<100; Value=23.9256
Definition=PESO1; 100<=Weight<110; Value=24.7521
Definition=PESO1; 110<=Weight<130; Value=28.4711
Definition=PESO1; 130<=Weight<150; Value=32.1901
Definition=PESO1; Weight=>150; Value=32.1901+0.242*(Weight-149)
Variable=ELECTRO; Value=evaluate_for_categories(Articles, 151)
*Variable=RESTO; Value=Articles-evaluate_for_categories(Articles, 151)
*Variable=ELECTROPESO; Value=evaluate_for_categories(Weight, 151)
*Variable=RESTOPESO; Value=Weight-evaluate_for_categories(Weight, 151)
Name={weight}Kg - GRATIS POR COMPRAS SUPERIORES A 150 €; Condition=ZONA1; Condition=not(ELECTRO); 150<=amountWithTax; Shipping=0
Name={weight}Kg - HAY ELECTRODOMÉSTICOS; Condition=ZONA1; 150<=amountWithTax; Shipping=PESO1

(*) Working on that

I have seen many examples in the forum and in the documentation but I am not able to apply it to my situation.
Please can you point me in the right direction?
Thanks

Shipping by weight, ZIP, and heavy products 02 Jul 2017 12:52 #2

Dear Sucolega,
If I understand you correctly, in the case with order amount >150€ you want to base your shipping cost not on the total weight, but just on the weight of all heavy products. In other words, depending on whether Amount>150 or Amount<=150, you want two different concepts of Weight. I would use a separate variable to store the weight to be used and then use that weight in all PESO1 rules:
Definition=ZONA1; Value=ZIP2 in list("04", "18", "23", "29", "14", "41", "11", "21")
Variable=myWeight; Value=Weight
Variable=myWeight; AmountWithTax>150; Value=evaluate_for_categories(Weight, 151)

Definition=PESO1; Value=0
Definition=PESO1; myWeight<5; Value=4.9174
Definition=PESO1; 5<=myWeight<10; Value=5.7438
Definition=PESO1; 10<=myWeight<15; Value=6.157
Definition=PESO1; 15<=myWeight<20; Value=6.9835
Definition=PESO1; 20<=myWeight<30; Value=8.6364
Definition=PESO1; 30<=myWeight<40; Value=10.2893
Definition=PESO1; 40<=myWeight<50; Value=11.9421
Definition=PESO1; 50<=myWeight<60; Value=14.4215
Definition=PESO1; 60<=myWeight<70; Value=16.4876
Definition=PESO1; 70<=myWeight<80; Value=18.9669
Definition=PESO1; 80<=myWeight<90; Value=21.4463
Definition=PESO1; 90<=myWeight<100; Value=23.9256
Definition=PESO1; 100<=myWeight<110; Value=24.7521
Definition=PESO1; 110<=myWeight<130; Value=28.4711
Definition=PESO1; 130<=myWeight<150; Value=32.1901
Definition=PESO1; myWeight=>150; Value=32.1901+0.242*(myWeight-149)


Name={weight}Kg - GRATIS POR COMPRAS SUPERIORES A 150 €; Condition=ZONA1; myWeight==0; 150<=amountWithTax; Shipping=0
Name={weight}Kg - Shipping rate above 150€ with heavy items; Condition=ZONA1; 150<=amountWithTax; Shipping=PESO1
Name={weight}Kg - Normal shipping rate below 150€ ; Condition=ZONA1; Shipping=PESO1

The third-to-last rule handles the case of >150€ with NO heavy items. We identify this case using the myWeight variable. if that is 0 wehn amountWithTax>=150, then no heavy items are in the cart.
The last two rules are identical and you need the second-to-last only if you want to print a different text for orders above 150€ that include heavy items. If you have multiple categories for your heavy products, simply include all of them in the evaluate_for_categories call, like evaluate_for_categories(Weight, 151, 152, 153, 154, 155)

Best regards,
Reinhold

Shipping by weight, ZIP, and heavy products 03 Jul 2017 10:47 #3

  • sucolega
  • sucolega's Avatar Topic Author
Thanks Reinhold! Works great!

[SOLVED] Shipping by weight, ZIP, and heavy products 04 Jul 2017 11:12 #4

Problem solved.

Shipping by weight, ZIP, and heavy products 08 Jun 2018 11:43 #5

  • sucolega
  • sucolega's Avatar Topic Author
Hi Reinhold, the rules are working so well but I need to add an exclusion to some of heavy products.

I need to include some heavy products from the categories previusly set to the free shipping rule. Some of the artícles from category 151 must be considered to the free shipping calculation when price is more than 150€.
I need to acomplish that by adding an additional category to that product, like category 2000.

If one product has category 151 and the price is more than 150€ -> No free shipping, the shipping cost is calculated by weight.
But if this product in the category 151 has another additional category, Category ID 2000, then is evaluated for free shipping if the price is more than 150€.

How can I do that? Can you help me?
Thanks in advanced.

This is my actual rule:

Definition=ZONA1; Value=ZIP2 in list("04", "18", "23", "29", "14", "41", "11", "21")
Variable=myWeight; Value=Weight
Variable=myWeight; AmountWithTax>100; Value=evaluate_for_categories(Weight, 151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,244,210,251,183,184,185)

Definition=PESO1; Value=0
Definition=PESO1; myWeight<2; Value=4.95
Definition=PESO1; 2<=myWeight<5; Value=5.95
Definition=PESO1; 5<=myWeight<10; Value=7.95
Definition=PESO1; 10<=myWeight<15; Value=8.95
Definition=PESO1; 15<=myWeight<20; Value=9.95
Definition=PESO1; 20<=myWeight<25; Value=10.95
Definition=PESO1; 25<=myWeight<30; Value=11.95
Definition=PESO1; 30<=myWeight<40; Value=14.5
Definition=PESO1; 40<=myWeight<50; Value=16.5
Definition=PESO1; myWeight=>50; Value=16.5+0.36*(myWeight-49)

Name=Envío GRATIS por compras superiores a 150 €; Condition=ZONA1; myWeight==0; 150<=amountWithTax; ShippingWithTax=0
Name=A; Condition=ZONA1; 150<=amountWithTax; ShippingWithTax=PESO1
Name=B; Condition=ZONA1; ShippingWithTax=PESO1

Shipping by weight, ZIP, and heavy products 08 Jun 2018 12:39 #6

  • sucolega
  • sucolega's Avatar Topic Author
Nevermind, I figured it out how to solve. I added a new variable after the list of categories for exclusion and it works as expected:

Definition=ZONA1; Value=ZIP2 in list("04", "18", "23", "29", "14", "41", "11", "21")
Variable=myWeight; Value=Weight
Variable=myWeight; AmountWithTax>150; Value=evaluate_for_categories(Weight, 151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,244,210,251,183,184,185)
Variable=myWeight; AmountWithTax>100; Value=Weight-evaluate_for_categories(Weight, 2000)
...

Thanks

(NOT SOLVED) Shipping by weight, ZIP, and heavy products 08 Sep 2018 18:59 #7

  • sucolega
  • sucolega's Avatar Topic Author
Hi again, I'm sorry but I never checked properly if it worked well and it does not. Can you please tell me how to do what I explained in the previous post?

(NOT SOLVED) Shipping by weight, ZIP, and heavy products 19 Oct 2018 17:17 #8

  • sucolega
  • sucolega's Avatar Topic Author
Hi, It's been more than a month, is it possible to get an answer on this topic please?
  • Page:
  • 1