VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

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

TOPIC: Rules for different sellers

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

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.

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

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

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

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


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:

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

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

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

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

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

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 ;)

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

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

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

  • Page:
  • 1

VM - Shopping cart

 x 

Cart empty

Login Formular