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!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Add extra cost 11 May 2016 13:15 #1

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
  • Offline
  • Posts: 48
Hello, i need to add an extra cost of 4 € to a certain category. I have these rules (category's id is 107)
Variable=Bottles; Value=Articles-evaluate_for_categories(Articles, 90, 100, 104, 105)
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)
Variable=Pack24; Value=ceil(evaluate_for_categories(Articles, 100)/24)
Variable=Pack20; Value=ceil(evaluate_for_categories(Articles, 104)/20)
Variable=Pack12; Value=ceil(evaluate_for_categories(Articles, 105)/12)
Variable=garrafas; Value=evaluate_for_categories(Articles, 90)
ExtraShippingCharge=8*Box12+4*Box6+2.55*Box3+8*Pack24+8*Pack20+4*Pack12+8*garrafas

Name="Miniaturas"; 107 in Categories; ExtraShippingCharge=4

With these rules i am adding besides an extra shipping cost of 4 € the extra cost of variables box3, box6 and box12. I just want to add 4 € to category 107

I tried this but it returns an error (Evaluation yields unknown value while evaluating rule part 'Box12'.)
Variable=Bottles; Value=Articles-evaluate_for_categories(Articles, 90, 100, 104, 105)
Variable=Box12; Condition=contains_none(Categories, 107); Value=round(Bottles/12-0.0001)
Variable=Box6; Condition=contains_none(Categories, 107); Value=round((Bottles-12*Box12)/6-0.0001)
Variable=Box3; Condition=contains_none(Categories, 107); Value=ceil((Bottles-12*Box12-6*Box6)/3)
Variable=Pack24; Condition=contains_none(Categories, 107); Value=ceil(evaluate_for_categories(Articles, 100)/24)
Variable=Pack20; Condition=contains_none(Categories, 107); Value=ceil(evaluate_for_categories(Articles, 104)/20)
Variable=Pack12; Condition=contains_none(Categories, 107); Value=ceil(evaluate_for_categories(Articles, 105)/12)
Variable=garrafas; Condition=contains_none(Categories, 107); Value=evaluate_for_categories(Articles, 90)
ExtraShippingCharge=8*Box12+4*Box6+2.55*Box3+8*Pack24+8*Pack20+4*Pack12+8*garrafas

Name="Miniaturas"; 107 in Categories; ExtraShippingCharge=4

Could you help me figure this out, please?

I havve VM2.6 and Advanced Shippping by Rules

Thanks!

Please Log in or Create an account to join the conversation.

Add extra cost 14 May 2016 19:07 #2

Dear Oysterrgirl,
I'm not sure I understand what you want to achieve. You say you want to add 4€ to category 107, but your rules seem to indicate that if any product from category 107 is bought, then NOT calculation into Boxes should be done at all, just an extra charge of 4€ added.

The error is clear: As you add some conditions to the definitions of Box12, Box6, etc, those variables will only be defined when category 107 is NOT in the cart.

As I said, I am really unsure what exactly you want to achieve. Could you describe your shipping cost structure in more detail, in particular the effects of having a product from category 107 in the cart.

Best regards,
Reinhold

Please Log in or Create an account to join the conversation.

Add extra cost 15 May 2016 09:04 #3

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
  • Offline
  • Posts: 48
Thank you so much for your reply Reinhold. Sorry, i didn't explain myself too clearly. We sell bottles of wine, and depending the number of articles in the shopping cart, an extra charge for a packaging box is added. Also, there's a few categories which items are sold in packs, and these have an added cost too.

Category 107 corresponds to miniature bottles, so, i'd need to add an extra charge of 4 € (which would be 1 box of 6 bottles) each time an article from this category is in the cart.

For example,12 miniature bottles (category 107) are in the cart -> there's an extra charge of 4 euros (just this extra charge, no extra charge for any more boxes). However, if 12 miniature bottles (category 107) + 12 bottles of red wine 75 cl (category 35) are in the cart -> an extra charge of 4 € is added from category 107 and another of 8 € (box of 12) is added.

Right now, with the rules if have posted if an article from category 107 is in the cart, the desired extra charge of 4 € is added, but the extra charge for a box, corresponding to the variables box12, box6, pack24, etc. is added too even if there are no items from any other categories in the cart. (this is the current behaviour wtth my rules as they are right now -> 12 miniature bottles in the cart --> extra charge of 4 € + 8 € for 1 box of 12) only the extra 4€ should be added). I'd like to know how can i do this.

Thanks again!

Please Log in or Create an account to join the conversation.

Add extra cost 20 May 2016 23:50 #4

Dear Oysterrgirl,
Thank you for the clarification. If I understand you correctly, you simply don't want articles from category 107 included in the "Bottles" variable that is used to calculate the number of boxes. Just modify the definition of Bottles to:
Variable=Bottles; Value=Articles-evaluate_for_categories(Articles, 90, 100, 104, 105, 107)
The mini bottles are then handled by the separate extra charge you have already included in your rules:
Name="Miniaturas"; 107 in Categories; ExtraShippingCharge=4

Best regards,
Reinhold

Please Log in or Create an account to join the conversation.

Add extra cost 24 May 2016 12:40 #5

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
  • Offline
  • Posts: 48
Excellent, thank you so much Reinhold :)

Please Log in or Create an account to join the conversation.

[SOLVED] Add extra cost 24 May 2016 12:41 #6

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
  • Offline
  • Posts: 48
Problem solved.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1

VM - Shopping cart

 x 

Cart empty

Login Formular