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:

Miscalculation of shipping volumes 19 Jan 2017 10:08 #1

  • windcommerce
  • windcommerce's Avatar Topic Author
VirtueMart version: 3.0.12
Joomla version: 13.1.0
PHP version: 5.5.9-1ubuntu4.14
Webserver: Apache

Hello,

we have some problems to calculate shipping costs because, by setting the volume calculation formula, the system inserts the shipping cost of a wrong price range.

The set rule is the follow:

Variable=DimWeight; Value=(2*Volume)/10000
Variable=BillableWeight; Value=max(DimWeight, Weight)

Name="0-3kg"; 0.1<BillableWeight<=3;Shipping=6.55
Name="B3-10kg"; 3.001<BillableWeight<10;Shipping=9.02
Name="B10-20kg"; 10.001<BillableWeight<20;Shipping=10.65
Name="B20-30kg"; 20.001<BillableWeight<30;Shipping=13.12
Name="B30-50kg"; 30.001<BillableWeight<50;Shipping=17.14
Name="B50-100kg"; 50.001<BillableWeight<100;Shipping=30.33

For example:

Consider three products:

P1: 27 cm x 21 cm x 10 cm. Weight: 6 Kg. Ordered: 3
P2: 46 cm x 24 cm x 49 cm. Weight: 8,60 Kg. Ordered: 2
P3: 8 cm x 5 cm x 3 cm. Weight: 0,20 Kg. Ordered: 1

The total weight is: 14,80 Kg.
Applying the formula the total volumetric weight is 25,06 Kg.

The price range must be: B20-30kg considering the volumetric weight, higher than the total weight in this case, but actually is B3-10kg and we don't know why?

Can you help us?

Miscalculation of shipping volumes 24 Jan 2017 22:23 #2

Dear WindCommerce,
I don't see any obvious issues with your rules.
My first guess would be that some of the dimensions of the products are off in your product definitions (but I guess you have cross-checked that already).

What I would do to debug such issues is to add a debug message that shows the corresponding variables in a message, so I can check whether all variables really have the values I expect. In particular, I would add something like the following between your variable definitions and the actual rules:
Message="Volume={Volume}, Weight={Weight}, DimWeight={DimWeight}, BillableWeight={BillableWeight}"; Value=0
This will print the four relevant variables in a debug message.

If that does not lead you anywhere, you can print out the full list of all variables:
Message="<pre>All variables: {Debug_Values}</pre>"; Value=0

Best regards,
Reinhold
  • Page:
  • 1