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:

Total quantity in multiples or 12 08 Jan 2016 14:16 #1

  • Web Design Domain
  • Web Design Domain's Avatar Topic Author
Hello
I have a wine store and wish to limit customers to purchases in multiples of 12. I have successfully added a rule for a minimum purchase of 12 by grouping all products under an additional Category(1) and applying the following rule :-

Name="The Sassy Wines Range has a minimum order quantity of 12. Please order in multiples of 12 bottles."; 1<=evaluate_for_categories(Articles, 1)<12; NoShipping

I cannot see how I can apply a rule for multiples of 12 only.

Can you help with a solution.

many thanks

john

Total quantity in multiples or 12 09 Jan 2016 18:28 #2

Dear John,
To check whether the number of articles are a multiple of 12 you can use the Modulo operator (which returns the remainder of a division by 12):
Name="The Sassy Wines Range sells wines only in packs of 12. Please order in multiples of 12 bottles."; evaluate_for_categories(Articles, 1)%12 <> 0; NoShipping

The Modulo calculation "evaluate_for_categories(Articles,1)%12" returns the remainder when you divide by 12. If that remainder is 0, then the number of bottles is a multiple of 12.

Best regards,
Reinhold
  • Page:
  • 1