Calculate and choose shipment based on weight (custom field!)

Started by tonsenson, July 21, 2015, 17:31:47 PM

Previous topic - Next topic

tonsenson

Hey there,

I searched and googled and did not find any helpful topics (I may be blind) so I hope there is anybody who can help :).

I have the following:
Joomla 3.4.1 with VM 3.0.9
Handful of products with a lot of variations, the weight for each product is set by a custom field 'weight' (I don't know why, did not set it up but it should have a reason).

There are a few shipment methods. Well, they are all the same method but one targets total cart weight 0 - 2 kg and costs 5 euro, the next ist 2.001 - 5 kg and costs 6 euro and so on.

The problem now is, that Virtuemart ("of course") does not recognize the custom field weight as the "real" weight, so it always displays the 0 - 2 kg shipment method.

With a few php additions I sum up the total weight of all the products. The question now is how do I tell Virtuemart to use my summed up total_weight so it can display the right shipment method in cart. I think I kinda just have to pass the totalweight value to the right variable? If so, which one is it? I am stuck on this for 2 hours now and am really sweating (cause it is too hot outside), so hopefully anybody has a good tip for me.

Oh and btw., first entry! Thanks for any help :)

have a nice day
Thomas

Dog_Guy

Hi,

I was having similar calculation issues and relied only on the auspost api (in australia).  But I also wanted to use a courier who charges different values based on weight and location (down to specific post codes etc).

I dont worry about using dimensions, but VM requires them, so I always put dummy values in, The weight is the main thing I need, and location ..

Found that this works really well - just need to follow the documentation on putting the right codes in the backend in the plugin.

Hope that helps.


http://www.open-tools.net/documentation/shipping-by-rules-plugins-for-virtuemart.html
You can buy healthy dog treats from either of my sites: http://www.dogwalkersmelbourne.com.au/ or http://www.healthydogtreats.com.au/

tonsenson

Hey Dog_Guy,

thanks for the answer. Actually I tried that plugin yesterday and found myself stuck in the weight-problem again. I just tried the free version of it and as I remember it can only handle the standard variables. Also I have to say that my programming skills are still pretty low so the phrase "Custom variables can be provided by vmshipmentrules extensions", which is a free-feature, scares me a little off.

Or am I completely wrong about that and Shipping by Rules actually can handle the custom field weight? Because the given standard weight field will not be used, I am sure about that.

Thanks for replying :)

jenkinhill

AFAIK the weight must be in the product_weight field of the xxx_virtuemart_products table - ie must be entered into the Product weight field on the Product Dimensions and Weight tab for each product.

I guess the same product with different weights could be product variants or child products, depending on what other differences there are, and these products set up accordingly.   
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

tonsenson

Hey,

yeah, I guess I really need to put the weight into the "native" weight field in the vm backend. That is, so far, the easiest solution for my problem for now. Thank you for the answer.

Tonsenson