Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Shipping By Rules for WooCommerce

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:

Rules for different sellers 22 Jun 2017 12:56 #1

  • cinthi
  • cinthi's Avatar Topic Author
Hello, I need rules for different vendors (I use wc vendors).
Each seller has a different shipping charge
Could you give me an example?

For example:

*Seller 1 / sell 5 products / more than 5 kg / shipping cost 10 euros

*Seller 2 / sell 5 products / less than 5 kg / shipping cost 5 euros

etc....

Please, I need that formula, thank you very much.

Rules for different sellers 26 Jun 2017 01:36 #2

Dear cinthi,
Do I understand you correctly that you want to calculate shipping costs based on all products from each individual seller, and the total shipping cost is then the sum of the shipping costs for each seller?

This will be quite some work to write the rules, because you will have to explicitly write the ruleset for each vendor... My approach would typically be to use a custom variable, set it to 0 at the beginning and then go through each vendor and simply add the vendor-specific shipping costs for that one vendor to the custom variable.

The rules for your two example above are (you can use the evaluate_for_vendors function):
Variable=MyShipping; Value=0

evaluate_for_vendors(Articles, "vendor1")>=5; evaluate_for_vendors(Weight, "vendor1")>5; MyShipping=MyShipping+10

evaluate_for_vendors(Articles, "vendor2")>=5; evaluate_for_vendors(Weight, "vendor2")<5; MyShipping=MyShipping+5
...
Shipping=MyShipping

Best regards,
Reinhold

Rules for different sellers 26 Jun 2017 12:38 #3

  • cinthi
  • cinthi's Avatar Topic Author

Hi Reinhold
Thanks for your help. But I think I've put something wrong because I can not get the rules to work.

I need shipping costs for each individal seller and that is based on the weight of the order.
example:
Seller 1 / less than 5 kg / 5 euros
Seller 1 / more than 5 kg / 8 euros
Seller 2 / less than 5 kg / 5 euros ... etc ... etc ...

Sorry, but this is very complicated for me :(
Attachments:

Rules for different sellers 26 Jun 2017 13:51 #4

  • cinthi
  • cinthi's Avatar Topic Author
I've finally got it,

The rules I have used are these:

Definition=myship; Value=0
Definition=myship; evaluate_for_vendors(Weight, "PRUEBA2")>5; Value=myship+10
Definition=myship; evaluate_for_vendors(Weight, "PRUEBA2")<5; Value=myship+5
Definition=myship; evaluate_for_vendors(Weight, "PRUEBA 1")>5; Value=myship+10
Definition=myship; evaluate_for_vendors(Weight, "PRUEBA 1")<5; Value=myship+5
Name="Gastos diferentes marcas"; Shipping=myship

Thanks

Rules for different sellers 26 Jun 2017 16:10 #5

  • cinthi
  • cinthi's Avatar Topic Author
Hi,
Now I have a question, if I want to have several prices according to weight, how do I put it?
example:
Up to 5 kg / 10 €
From 5 kg to 10 kg / 14 €
10 kg to 15 kg / 17 €

Thanks ;)

Rules for different sellers 02 Jul 2017 12:35 #6

Dear Cinthi,
to have several prices, you'll simply need to adjust the condition on the vendor-weight with upper and lower bounds:
Definition=myship; 15>=evaluate_for_vendors(Weight, "PRUEBA2")>10; Value=myship+17
Definition=myship; 10>=evaluate_for_vendors(Weight, "PRUEBA2")>5; Value=myship+14
Definition=myship; 5>=evaluate_for_vendors(Weight, "PRUEBA2"); Value=myship+10

Please notice that in your rule you check whether the weight of vendor PRUEBA2 is strictly larger and strictly smaller than 5kg. The case where exactly 5kg are bought is NOT handled and will not incur any shipping cost. I think that you might want to use <=5 in your second and fourth rule, which means 5 Euros shipping UP TO 5kg (and not less than 5kg as you wrote in your posting).

Best regards,
Reinhold
  • Page:
  • 1