The function to get the total weight of goods and calculate the shipping charge (i.e. Charge Per Additional Pound (Over 1lb) doesn't appear to work. I get only the flat rate for one item added at checkout.
Also:
I noticed the weight attribute disappeared from the product form when both ups.inc and canada.inc were removed.
The Shipcalc _product_form hook was not doing its job:
function weight_product_form(&$form) {
$form['shipping_data']['product_weight'] = array(
'#type' => 'textfield',
'#title' => t('Product weight'),
'#description' => t('The weight of the product (in %unit)', array('%unit'=> (variable_get('shipcalc_units', 'LBS')) ? t('pounds') : t('kilograms'))),
'#default_value' => $form['#node']->product_weight
);
}Instead, if modified to be the same as the ups and canada files, it does indeed enhance the product form, and weight.inc does its job of adding a shipping charge to the cart:
function weight_product_attributes($form) {
$fields = array();
$fields['weight'] = array(
'#type' => 'textfield',
'#title' => t('Product weight'),
'#description' => t('The weight of the product (in %unit)', array('%unit'=> (variable_get('shipcalc_units', 'LBS')) ? t('pounds') : t('kilograms'))),
'#default_value' => $form['#node']->product_attributes['weight']
);
return $fields;
} The original code seems to be copied from 'usps.inc', which may not work either.
Also, I would like to know where the shipcalc units are set, so I can work in Kilos or grams, if any one could help please.
Comments
Comment #1
simefixing component
Comment #2
simeOh wait, this is weight.inc.
Please refer flexicharge.