Hello David,
In that case the solution will be to edit the file "plugins\hikashopshipping\usps/usps.php" and :
1. add that line :
'weight_approximation_fixed' => array('Weight approximation', 'input'),
Just behind this line :
'weight_approximation' => array('Weight approximation (%)', 'input'),
2. Add these lines :
if (!empty($rate->shipping_params->weight_approximation_fixed)) {
if (isset($product->product_weight)) $product->product_weight = round($product->product_weight + (float)$rate->shipping_params->weight_approximation_fixed, 2);
if (isset($product->product_weight_orig)) $product->product_weight_orig = round($product->product_weight_orig + (float)$rate->shipping_params->weight_approximation_fixed, 2);
}
just after these lines :
if (!empty($rate->shipping_params->weight_approximation)) {
if (isset($product->product_weight)) $product->product_weight = $product->product_weight + $product->product_weight * $rate->shipping_params->weight_approximation / 100;
if (isset($product->product_weight_orig)) $product->product_weight_orig = $product->product_weight_orig + $product->product_weight_orig * $rate->shipping_params->weight_approximation / 100;
}
3. Add these lines :
if (!empty($rate->shipping_params->weight_approximation_fixed)) {
if (isset($variant->product_weight)) $variant->product_weight = round($variant->product_weight + (float)$rate->shipping_params->weight_approximation_fixed, 2);
if (isset($variant->product_weight_orig)) $variant->product_weight_orig = round($variant->product_weight_orig + (float)$rate->shipping_params->weight_approximation_fixed, 2);
}
After these lines :
if (!empty($rate->shipping_params->weight_approximation)) {
if (isset($variant->product_weight)) $variant->product_weight = $variant->product_weight + $variant->product_weight * $rate->shipping_params->weight_approximation / 100;
if (isset($variant->product_weight_orig)) $variant->product_weight_orig = $variant->product_weight_orig + $variant->product_weight_orig * $rate->shipping_params->weight_approximation / 100;
}
And you'll have a new "Weight approximation" option which will add a fixed amount to the weight of your products and not a percentage.
Kind regards,
Mohamed.