In the USPS shipping module:
/includes/modules/shipping/usps.php
you will see around line 229 the line:
Code:
$cost = preg_replace('/[^0-9.]/', '', $cost);
Below that line add:
Code:
global $cart;
$chk_guns = $_SESSION['cart']->in_cart_check('master_categories_id','2');
$chk_rifles = $_SESSION['cart']->in_cart_check('master_categories_id','3');
$extra_handling_fee = ($chk_guns * 50) + ($chk_rifles * 35);
This is calculating how many Guns from categories_id 2 and Rifles from categories_id 3, using the master_categories_id of the Products and multiplying them by 50 for Guns and 35 for Rifles ...
This creates the:
$extra_handling_fee
which holds this amount ...
Now add the $extra_handling_fee to the final cost in the next section of code:
Code:
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) + $extra_handling_fee );
If you take out the 50.00 from the Handling Fee that you setup in the USPS shipping module, does this now add the correct additional cost?