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!

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

TOPIC: [SOLVED] Separate products purchased from the same vendor

Separate products purchased from the same vendor 25 Apr 2017 20:28 #1

Dear Reinhold,

I use your advanced plugin on my marketplace (woocommerce/wc vendors)
I configure your plugin to respect the delivery rules of my sellers.

I have a question about the calculation of the shipping cost when a buyer choose 2 separate products from the same vendor.

Here is my formula for the calculation of the sum of the shipping costs.
It is based on the SKU because there is a shipping cost per product (and per quantity).

Variable=Shippingcalc;Value=0
Variable=Shippingcalc; "product1" in SKUs;evaluate_for_vendors(Articles,"VendorA")==1;Value=7
Variable=Shippingcalc; "product2" in SKUs;evaluate_for_vendors(Articles,"VendorA")==1;Value=5
Shipping=Shippingcalc


If a buyer add 1 product1 and 1 product2 in the shopping cart, the displayed amount should be 7+5=12.
But the amount displayed is 14 (twice the first shipping cost).

Is there a mistake in my code?

Thanks in advance.

Arnaud

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

Separate products purchased from the same vendor 29 Apr 2017 19:07 #2

Dear Arnaud,
If you have different shipping costs per product, and a limited number of products, I would suggest to use evaluate_for_products instead and include the articles directly in the value:
Variable=Shippingcalc; Value=0
Variable=Shippingcalc; Value=Shippingcalc+7*evaluate_for_products(Articles, "product1") + 5*evaluate_for_products(Articles, "product2")
Shipping=Shippingcalc

Best regards,
Reinhold

PS: The "mistake" in your code is the assumption that shipping costs are specified per product. You need to explicitly include the quantity in the cost. And the other mistake is the assumption that the values are automatically added, i.e. you need to use Value=Shippingcalc+7*evaluate_for_....

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

[SOLVED] Separate products purchased from the same vendor 02 May 2017 15:17 #3

Problem solved.

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

  • Page:
  • 1

VM - Shopping cart

 x 

Cart empty

Login Formular