Using version 2.0? There is a new snippet available for our latest version, available from here.
Versions 0.7.1 and older: Note that applying javascript shipping modifications using either live or flat rates where you are setting custom values has been found to not work as expected for subscription based products where you need the shipping to apply to each subscription renewal. A fix is in place for versions 0.7.2 and newer.
For some stores shipping larger products, it can be possible to go over the weight limit for the shipping provider, in which case your customers just receive an error saying that the rates can't be calculated. This script works around that by setting the shipment weight to a smaller acceptable weight and calculating the shipping by the returned rate for the smaller package multiplied by how many of the smaller packages there are. Not perfect, but a great work around until more powerful shipping is implemented in an upcoming version.
Paste the following code above the closing </head> tag in your checkout template:
<script type="text/javascript" charset="utf-8"> jQuery(document).ready(function() { maximum_weight = 70; package_weight = 30; // set custom packages to the expected default of 1 custom_packages = 1; if (fc_json.total_weight > maximum_weight) { custom_packages = fc_json.total_weight/package_weight; FC.checkout.config.orderShipmentWeight = package_weight; } jQuery(document).ajaxComplete(function(event, request, settings) { if (settings.url.indexOf('GetShippingCost') != -1) { jQuery("#fc_shipping_methods_inner input.fc_radio").each(function() { var rate = jQuery(this).val().split("|"); var adjusted_total = parseFloat(rate[1]) * custom_packages; jQuery(this).val(rate[0] + "|" + adjusted_total).siblings(".fc_shipping_cost").html(FC.formatter.currency(adjusted_total, true)); }); } }); }); </script>
<script type="text/javascript" charset="utf-8"> jQuery(document).ready(function() { maximum_weight = 70; package_weight = 30; // set custom packages to the expected default of 1 custom_packages = 1; if (fc_json.total_weight > maximum_weight) { custom_packages = fc_json.total_weight/package_weight; FC.checkout.config.orderLiveRateShipmentWeight = package_weight; } jQuery(document).ajaxComplete(function(event, request, settings) { if (settings.url.indexOf('GetShippingCost') != -1) { jQuery("#fc_shipping_methods_inner input.fc_radio").each(function() { var rate = jQuery(this).val().split("|"); var adjusted_total = parseFloat(rate[1]) * custom_packages; jQuery(this).val(rate[0] + "|" + adjusted_total).siblings(".fc_shipping_cost").html(FC.formatter.currency(adjusted_total, true)); }); } }); }); </script>
To customise the script, edit the two variables at the start of the script called 'maximum_weight' (set to the heaviest package your shipping provider will return rates for) and 'package_weight' (the size of the smaller package you will send larger shipments in). Obviously, 'package_weight' must be smaller than 'maximum_weight' and should take into account the products your shipping. For example, if the products you're shipping are 30lb and 40lb, and the shipping maximum is 70lb, set your package_weight to 40lb.