Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_sidebar.php on line 8

Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_menu.php on line 278

VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: Exclude weight

Exclude weight 09 Jul 2017 20:50 #1

Hello, i am trying to implement the following:
When only item from Manufacturer 11 is on cart then shipping is 0
When only item from Manufacturer 9 is on cart and the price is bigger than 25 (of that product, not the entire order) then shipping is 0
When both of the above only the shipping is also 0
If i have other products also in the basket then it should just remove the weight of the above products and continue weight based calculation.

What i created so far...

Name=Offer A; evaluate_for_manufacturers(Articles, 11)==Articles; Shipping=0
Name=Offer B; evaluate_for_manufacturers(Articles, 9)==Articles; 25<=Amount; Shipping=0
0.1<=Weight<=2000; Shipping=2
2001<=Weight<=3000; Shipping=2.8
3001<=Weight<=4000; Shipping=3.6
4001<=Weight<=5000; Shipping=4.4
5001<=Weight<=6000; Shipping=5.2
6001<=Weight<=7000; Shipping=6.0
7001<=Weight<=8000; Shipping=6.8

As you notice, i havent found out how to exclude the weight or if i have both manufacturers.

Any help really appreciated!
Thank you
The administrator has disabled public write access.

Exclude weight 15 Jul 2017 18:11 #2

Dear Panosjules,
If I understand you correctly, you want to base all the weight conditions of the third and subsequent rules on the weight excluding categories 9 and 11. In that case, you can simply use a custom variable that calculates the weight of the order excluding categories 9 and 11. You would then use that custom variable instead of the Weight variable in your conditions:
Name=Offer A; evaluate_for_manufacturers(Articles, 11)==Articles; Shipping=0
Name=Offer B; evaluate_for_manufacturers(Articles, 9)==Articles; 25<=Amount; Shipping=0
Variable=myWeight; Value=Weight-evaluate_for_manufacturers(Weight, 11, 9)
0.1<=myWeight<=2000; Shipping=2
2001<=myWeight<=3000; Shipping=2.8
...

What is not handled by this code yet is the case when articles from manufacturers 9 and 11 are in the cart, but no other products (you'll add an additional rule after the first two rules to handle this case graciously.

Also,your second case (only items from manufacturer 9 with price above 25) is not entirely clear to me. If a customer buys two products from manufacturer 9, do you want to give free shipping only to individual products that cost more than 25, or is is sufficient if the customer buys articles worth at least 25 from manufacturer 9? The first case would be quite hard to solve, as our plugin does not allow conditions on individual products.
In the second case, you need to replace 25<=Amount by 25<=evaluate_for_manufacturers(Amount, 9) to implement your third rule (with products from manufacturers 9 and 11.

Also, should all products from manufacturers 9 be excluded for mixed carts, or do you only want to exclude them if the price of products from manufacturer 9 is above 25? In the latter case, you'll need to add an additional condition in the definition of myWeight to exclude products from manuf 9 only if that additional condition is fulfilled.

Best regards,
Reinhold
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular