Shipping Surcharge

I’m currently using UPS realtime shipping to calculate charges. Is it possible to take this shipping quote and add a percent (say 10%) to cover handling charges?





ver.

You can add a surcharge via the payment methods.

There is currently no way to charge a percentage of the shipping charge as a surcharge without modifying the code. I know this request has come up in the past - maybe something to add to UserVoice system.



Bob

You can however add an additional flat fee to each realtime shipment calculated, perhaps that will help your situation.

This should be added to CSC. I can’t believe it would be that much of an effort to do it. I’ll add a comment to the Shipping user voice request if there is not already one there on this topic. For those of us who work on narrow margins, making a little back via a ship surcharge is a good thing. The flat fee works but it’s tough to get a good average when shipping something ground is $5 and priority overnight is $50. The surcharge percentage is a much better way to go.

The edit is pretty easy actually. You just change the calculation in fn.cart.php from +surcharge to +(shipping/surcharge). I don’t have the line off hand but that would change a static surcharge to a percentage.

I looked for that bit of code in the file you mentioned, only saw something similar at line 351 (CSC 2.0.15). I am not a coder so this may or may not be the section you were talking about.



I use realtime rates from Fedex and want to add a 10% surcharge on those rates. So Ground at $5 becomes $5.50 and Priority Overnight at $50 becomes $55. Of course the rates change with every shipment based on location and weight.



Can you give me some help on what you did to accomplish this?



thx

Got it. So export each product and set the appropriate surcharge percentage as a plain number in the “shipping freight ($)” box (i.e. 5, 10, 15, 20).



In “core/fn.cart.php” find the line (about 1668):


$shipping_freight += ($v['shipping_freight'] * $v['amount']);




comment that line out and place this line after it:



$shipping_freight = $v['shipping_freight'];




Next, on line (about 1680), comment out this line:



$shipping_rates[$shipping_id]['rates'][$o_id] = $rate_value + $shipping_freight;




and add these lines after it:



if ($shipping_freight > 0) { $shipping_rates[$shipping_id]['rates'][$o_id] = $rate_value + ($rate_value*($shipping_freight/100)); }
else { $shipping_rates[$shipping_id]['rates'][$o_id] = $rate_value; }




Now the “Shipping freight ($):” is no longer a static dollar amount, instead it is a percentage value added to shipping.

[quote name=‘ChrisW’]This should be added to CSC. I can’t believe it would be that much of an effort to do it. I’ll add a comment to the Shipping user voice request if there is not already one there on this topic. For those of us who work on narrow margins, making a little back via a ship surcharge is a good thing. The flat fee works but it’s tough to get a good average when shipping something ground is $5 and priority overnight is $50. The surcharge percentage is a much better way to go.[/QUOTE]



I think perhaps handling costs of as much shipping should be built into the the price.



You then can add a standard average packing fee bases on each shipping option. Local $1 and if you have fill a form for distance shiping then perhaps $2 ?



That keeps it simple and the doesn’t had overheads to the code processing.

Thanks gginorio that is a nice hack and does what I need it to do. Haven’t done a complete test yet but the initial results are good. A ground rate of $8.45 went up to $9.30 and overnight went from $54.13 to $59.54 with a 10% surcharge.



Instead of the import, I updated the entire products database to set the surcharge to 10 as I want to add 10% to every ship rate per product.



update cscart_products set shipping_freight = 10




Thanks again you saved me some time and $ on a mod!



Chris

No worries. That’s why my sig says, “Working on making things better”.