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:

Weight + cost of the package 04 Jun 2015 00:07 #1

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
Hi, i need help. We sell bottles of wine and i need the plugin to add the cost of the package, which is:

box for 3 bottles: 2,55 €
box for 6 bottles: 4 €
box for 12 bottles: 8 €

There's a couple of categories that include products that don't need this packaging for bottles ( they are packs of beer). How can i calculate the cost of the shipping for orders that would include products from these categories? providing the rest of the products in the shopping cart would need to have the packaging added. This is my current set of rules:

Comment=Express Delivery 3-6 working days; MinWeight==0; NoShipping
Name=Express Delivery 3-6 working days; 0<Weight<=3; 1=<Articles<=3; shipping=14.83+2.55
Name=Express Delivery 3-6 working days; 3<Weight<=5; 1=<Articles<=3; shipping=15.98+2.55
Name=Express Delivery 3-6 working days; 5<Weight<=10; 1=<Articles<=3; shipping=22.67+2.55
Name=Express Delivery 3-6 working days; 10<Weight<=15; 1=<Articles<=3; shipping=26.82+2.55
Name=Express Delivery 3-6 working days; 0<Weight<=3; 3<Articles<=6; shipping=14.83+4
Name=Express Delivery 3-6 working days; 3<Weight<=5; 3<Articles<=6; shipping=15.98+4
Name=Express Delivery 3-6 working days; 5<Weight<=10; 3<Articles<=6; shipping=22.67+4
Name=Express Delivery 3-6 working days; 10<Weight<=15; 3<Articles<=6; shipping=26.82+4
Name=Express Delivery 3-6 working days; 15<Weight<=20; 3<Articles<=6; shipping=32.00+4
Name=Express Delivery 3-6 working days; 20<Weight<=25; 3<Articles<=6; shipping=34.37+4
Name=Express Delivery 3-6 working days; 25<Weight<=30; 3<Articles<=6; shipping=37.78+4
Name=Express Delivery 3-6 working days; 3<Weight<=5; 6<Articles<=9; shipping=15.98+6.55
Name=Express Delivery 3-6 working days; 5<Weight<=10; 6<Articles<=9; shipping=22.67+6.55
Name=Express Delivery 3-6 working days; 10<Weight<=15; 6<Articles<=9; shipping=26.82+6.55
Name=Express Delivery 3-6 working days; 15<Weight<=20; 6<Articles<=9; shipping=32.00+6.55
Name=Express Delivery 3-6 working days; 20<Weight<=25; 6<Articles<=9; shipping=34.37+6.55
Name=Express Delivery 3-6 working days; 25<Weight<=30; 6<Articles<=9; shipping=37.78+6.55
Name=Express Delivery 3-6 working days; 30<Weight<=35; 6<Articles<=9; shipping=42.49+6.55
Name=Express Delivery 3-6 working days; 5<Weight<=10; 9<Articles<=12; shipping=22.67+8
Name=Express Delivery 3-6 working days; 10<Weight<=15; 9<Articles<=12; shipping=26.82+8
Name=Express Delivery 3-6 working days; 15<Weight<=20; 9<Articles<=12; shipping=32.00+8
Name=Express Delivery 3-6 working days; 20<Weight<=25; 9<Articles<=12; shipping=34.37+8
Name=Express Delivery 3-6 working days; 25<Weight<=30; 9<Articles<=12; shipping=37.78+8
Name=Express Delivery 3-6 working days; 30<Weight<=35; 9<Articles<=12; shipping=42.49+8
Name=Express Delivery 3-6 working days; 35<Weight<=40; 9<Articles<=12; shipping=45.95+8
Name=Express Delivery 3-6 working days; 40<Weight<=45; 9<Articles<=12; shipping=64.39+8
Name=Express Delivery 3-6 working days; 45<Weight<=50; 9<Articles<=12; shipping=70.15+8
Name=Express Delivery 3-6 working days; 5<Weight<=10; 12<Articles<=15; shipping=22.67+10.55
Name=Express Delivery 3-6 working days; 10<Weight<=15; 12<Articles<=15; shipping=26.82+10.55
Name=Express Delivery 3-6 working days; 15<Weight<=20; 12<Articles<=15; shipping=32.00+10.55
Name=Express Delivery 3-6 working days; 20<Weight<=25; 12<Articles<=15; shipping=34.37+10.55
Name=Express Delivery 3-6 working days; 25<Weight<=30; 12<Articles<=15; shipping=37.78+10.55
Name=Express Delivery 3-6 working days; 30<Weight<=35; 12<Articles<=15; shipping=42.49+10.55
Name=Express Delivery 3-6 working days; 35<Weight<=40; 12<Articles<=15; shipping=45.95+10.55
Name=Express Delivery 3-6 working days; 40<Weight<=45; 12<Articles<=15; shipping=64.39+10.55
Name=Express Delivery 3-6 working days; 45<Weight<=50; 12<Articles<=15; shipping=70.15+10.55
Name=Express Delivery 3-6 working days; 5<Weight<=10; 15<Articles<=18; shipping=22.67+12
Name=Express Delivery 3-6 working days; 10<Weight<=15; 15<Articles<=18; shipping=26.82+12
Name=Express Delivery 3-6 working days; 15<Weight<=20; 15<Articles<=18; shipping=32.00+12
Name=Express Delivery 3-6 working days; 20<Weight<=25; 15<Articles<=18; shipping=34.37+12
Name=Express Delivery 3-6 working days; 25<Weight<=30; 15<Articles<=18; shipping=37.78+12
Name=Express Delivery 3-6 working days; 30<Weight<=35; 15<Articles<=18; shipping=42.49+12
Name=Express Delivery 3-6 working days; 35<Weight<=40; 15<Articles<=18; shipping=45.95+12
Name=Express Delivery 3-6 working days; 40<Weight<=45; 15<Articles<=18; shipping=64.39+12
Name=Express Delivery 3-6 working days; 45<Weight<=50; 15<Articles<=18; shipping=70.15+12
Name=Express Delivery 3-6 working days; 5<Weight<=10; 18<Articles<=21; shipping=22.67+14.55
Name=Express Delivery 3-6 working days; 10<Weight<=15; 18<Articles<=21; shipping=26.82+14.55
Name=Express Delivery 3-6 working days; 15<Weight<=20; 18<Articles<=21; shipping=32.00+14.55
Name=Express Delivery 3-6 working days; 20<Weight<=25; 18<Articles<=21; shipping=34.37+14.55
Name=Express Delivery 3-6 working days; 25<Weight<=30; 18<Articles<=21; shipping=37.78+14.55
Name=Express Delivery 3-6 working days; 30<Weight<=35; 18<Articles<=21; shipping=42.49+14.55
Name=Express Delivery 3-6 working days; 35<Weight<=40; 18<Articles<=21; shipping=45.95+14.55
Name=Express Delivery 3-6 working days; 40<Weight<=45; 18<Articles<=21; shipping=64.39+14.55
Name=Express Delivery 3-6 working days; 45<Weight<=50; 18<Articles<=21; shipping=70.15+14.55
Name=Please, request a shipping quote for bulk orders; Weight>50; Articles>21; NoShipping

Also, i get this error message when the shopping cart is emptied:

Unknown rule type '' encountered for rule ' '
Unknown rule type '' encountered for rule ' '

I'm using Advanced Shipping by Rules and Virtuemart 2.6

Kind regards

Weight + cost of the package 09 Jun 2015 03:06 #2

Dear Oysterrgirl,
Regarding your question about beers not requiring this packaging, you can use evaluate_for_categories to get the actual amount of bottles (i.e. the total number of articles in the order minus the number of packs of beer):
Variable=Bottles; Value=Articles-evaluate_for_categories(Articles, 1234)
Here, 1234 is the ID of the beer category. You can then use the variable Bottles later on just like any other variable.

Your extra shipping charge for bottles can also be implemented much easier using ExtraShippingCharge:
Variable=Box12; Value=round(Bottles/12-0.0001)
Variable=Box6; Value=round((Bottles-12*Box12)/6-0.0001)
Variable=Box3; Value=ceil((Bottles-12*Box12-6*Box6)/3)
ExtraShippingCharge=8*Box12+4*Box6+2.55*Box3

Place this at the top of your shipping rules, and the extra charge will be added to whatever rule matches later on.
This saves you a lot of duplicated rules...

Best regards,
Reinhold

Weight + cost of the package 09 Jun 2015 09:39 #3

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
Thank you so much for your reply, Reinhold.

How should i use the 'bottles' and 'box' variables?

I've tried this but it's obviously not correct:

Variable=Bottles; Value=Articles-evaluate_for_categories(Articles, 1234)
Variable=Box12; Value=round(Bottles/12-0.0001)
Variable=Box6; Value=round((Bottles-12*Box12)/6-0.0001)
Variable=Box3; Value=ceil((Bottles-12*Box12-6*Box6)/3)
ExtraShippingCharge=8*Box12+4*Box6+2.55*Box3
Name=Express Delivery; 0<Weight<=3; Variable=Bottles; Shipping=14.83
Name=Express Delivery; 3<Weight<=5; Variable=Bottles; Shipping=15.98
Name=Express Delivery; 5<Weight<=10; Variable=Bottles; Shipping=22.67

Thanks again.

Weight + cost of the package 12 Jun 2015 18:08 #4

Dear Oyeterrgirl,
The whole point of ExtraShippingCharge is that you specify the extra charge ONCE and it will always be added to the shipping cost. In particular, you don't have to use the Bottles variable any more in the rules. The extra shipping charge will be automatically added to the 14.83 or 15.98 or 22.67€. So your rules should simply be (you'll need to replace the 1234 in the Bottles definition by the actual ID of your beer can category):
Variable=Bottles; Value=Articles-evaluate_for_categories(Articles, 1234)
Variable=Box12; Value=round(Bottles/12-0.0001)
Variable=Box6; Value=round((Bottles-12*Box12)/6-0.0001)
Variable=Box3; Value=ceil((Bottles-12*Box12-6*Box6)/3)
ExtraShippingCharge=8*Box12+4*Box6+2.55*Box3
Name=Express Delivery; 0<Weight<=3; Shipping=14.83
Name=Express Delivery; 3<Weight<=5; Shipping=15.98
Name=Express Delivery; 5<Weight<=10; Shipping=22.67

Best regards,
Reinhold

Weight + cost of the package 17 Jun 2015 19:19 #5

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
Excellent, thank you so much :)

[SOLVED] Weight + cost of the package 17 Jun 2015 19:19 #6

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
Problem solved.
  • Page:
  • 1