I've implemented the following custom shipping logic to allow for free Media Mail shipping. My cart works fine without it when I have Use Custom Shipping Logic set to NO. When I turn it on, I start seeing this error in my log occasionally and the store isn't accessible for a while (500 error):
[Mon May 9 18:40:46 2005] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: /home/mysite/public_html/store/agora.cgi
@sc_shipping_logic = ( "FREE SHIPPING|||0.0-100.0|0.00",
"USPS Priority Mail|||0.0-1.00|4.99",
"USPS Priority Mail|||1.01-2.00|7.99",
"USPS Priority Mail|||2.01-3.00|11.99",
"USPS Priority Mail|||3.01-4.00|13.99",
"USPS Priority Mail|||4.01-5.00|14.99",
"USPS Priority Mail|||5.01-6.00|14.99",
"USPS Priority Mail|||6.01-7.00|16.99",
"USPS Priority Mail|||7.01-8.00|17.99",
"USPS Priority Mail|||8.01-9.00|19.99",
"USPS Priority Mail|||9.01-10.00|22.99",
"USPS Priority Mail|||10.01-11.00|23.99",
"USPS Priority Mail|||11.01-12.00|24.99",
"USPS Priority Mail|||12.01-13.00|26.99",
"USPS Priority Mail|||13.01-14.00|27.99",
"USPS Priority Mail|||14.01-15.00|29.99",
"USPS Priority Mail|||15.01-16.00|31.99",
"USPS Priority Mail|||16.01-17.00|33.99",
"USPS Priority Mail|||17.01-18.00|35.99",
"USPS Priority Mail|||18.01-19.00|37.99",
"USPS Priority Mail|||19.01-20.00|39.99",
"USPS Priority Mail|||20.01-|49.99");
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
Is there something I did wrong with the custom code? As I said, if I just use the SBW module (which is OFF when I use this code), everything is OK but I REALLY want to use this custom code to offer free shipping.
Any ideas?