Hi,

i'm using kg as a measuring unit but if i call

$weight = commerce_physical_order_weight($order, 'kg');

it returns null while if i call

$weight = commerce_physical_order_weight($order, 'lb');

this works but it returns the converted weight. How should i do?

Comments

joachim’s picture

Priority: Normal » Major

I'd say that's pretty major.

Also, it blocks use of this module by http://drupal.org/project/issues/commerce_shipping_weight_tariff

cvangysel’s picture

I've got an order containing a single line item, which references a product that has a weight of 5kg. The following code runs just fine on my install:

$order = commerce_order_load(18);

dpm(commerce_physical_order_weight($order, 'kg'));
dpm(commerce_physical_order_weight($order, 'lb'));

Could you maybe give some more information about the problem you're having?

das-peter’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Just checked the related code, looks fine to me - conversion takes place.
However, it relies on the Physical Fields Module.
Without further information I've to consider this resolved / postponed.