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:

Multivendor shipping 14 Jul 2015 13:42 #1

  • mdelreal
  • mdelreal's Avatar Topic Author
Hi,

Now i am develop a multi vendor store. I have a question, can i set rules using the number of vendors?

Thanks
Manuel

Multivendor shipping 16 Jul 2015 17:51 #2

The list of vendors of all products in the cart is available via the vendors variable. The number of vendors is length(vendors).
You can also calculate all quantities per vendor using the function
evaluate_for_vendors(EXPRESSION, vendorID)

See the documentation of the plugin:
List of variables: open-tools.net/documentation/shipping-by...emart.html#variables
Scoping functions: open-tools.net/documentation/shipping-by...tuemart.html#scoping

Best regards,
Reinhold

Multivendor shipping 26 Jul 2015 16:13 #3

  • mdelreal
  • mdelreal's Avatar Topic Author
Thanks Reinhold,

Length(vendors) works fine, but i don't understand well the evaluate_for_vendor.

If for example i have in the same cart:

- Some products from a vendor 1 with a weight of 500 gr, weight that should have cost 5 €
 - Some products from a vendor 2 with a weight of 50 gr, weight that should have cost 2 €.

How could I do to make me calculate the basket € 5 + 2 €?

Thanks lot for your help
Manuel

Multivendor shipping 02 Aug 2015 16:18 #4

If you have only those two vendors, I would do it like (:
Variable=vendor1cost; Value=0
Variable=vendor1cost; evaluate_for_vendor(Weight,1)<=500; Value=5
Variable=vendor2cost; Value=0
Variable=vendor2cost;  evaluate_for_vendor(Weight,2)<=100; Value=2
Shipping=vendor1cost+vendor2cost

As you might imagine, you would then simply add the vendor-specifig shipping costs together with the two rules involving evaluate_for_vendor. Basically, you calculate the shipping cost for each vendor separately (using e.g. evaluate_for_vendor(weight,1) to get the weight of all products of vendor 1) and store them in the variables vendor1cost and vendor2cost. The final shipping cost is then the sum of these two.
I gave one example rule with one weight bound, you will probably have to add several more rules for each vendor, and in those use evaluate_for_vendor. The details depend on how you calculate the shipping e.g. for vendor 1 exactly (what are the exact conditions?). Without further details, one cannot write the final/finished rules. But I think the example I gave above gives you a good start to adjust them to your shipping cost structure.

Best regards,
Reinhold

Multivendor shipping 06 Sep 2015 13:22 #5

  • mdelreal
  • mdelreal's Avatar Topic Author
Hi Reinhold,

I've tried your sample:

Variable=vendor1cost; Value=0
Variable=vendor1cost; evaluate_for_vendors(Weight,3)<=200; Value=2
Variable=vendor2cost; Value=0
Variable=vendor2cost; evaluate_for_vendors(Weight,4)<=5000; Value=5
Shipping=vendor1cost+vendor2cost

And it's strange, i've add a product from vendor 4 and it's rule works, but always apply the rule from vendor 3. I mean, if the weight less than 5000 grams, apply the cost of both, from 5000 grams of the vendor applies the three (when product is the seller 4). I understand that the rules should apply only to the vendor 4, no?

Another question, and add also the limitation for ZIP. Use for example Variable=vendor2cost; 01000>=ZIP<=28999; evaluate_for_vendors(Weight,4)<=5000; Value=5?

Thanks
Manuel

Multivendor shipping 12 Sep 2015 14:24 #6

Dear Manuel,
If there are no products from vendor 3, then the weight of products from vendor 3 is 0, which also mathes your check <=200...
Basically, you also need to check that there are really an products from vendor 3 in the cart. You can easily do this by checking the vendors list (which is a list of all vendors in the cart):
Variable=vendor1cost; Value=0
Variable=vendor1cost; 3 in vendors; evaluate_for_vendors(Weight,3)<=200; Value=2
Variable=vendor2cost; Value=0
Variable=vendor2cost; 4 in vendors; evaluate_for_vendors(Weight,4)<=5000; Value=5
Shipping=vendor1cost+vendor2cost

Best regards,
Reinhold
  • Page:
  • 1