If you've had some custom needs for shipping in your Foxy 2.0 Store, then odds are that you're utilising one of the snippets available on our wiki. If that's you, we would highly recommend migrating from the existing snippet over to the new native custom shipping code functionality.
Below are some notes for moving over to the new functionality from some of the more common snippets.
If you have any questions about, or need help with migrating, your specific snippet set up, please get in contact with us and we'll be happy to help.
This snippet added the ability to modify the live rates that were returned from third-party carriers like USPS, FedEx and UPS, as well as add in custom rates too. As the new custom shipping code functionality is executed after any selected carriers for a store, and is passed those rates to begin with, you can peform the same functionality in the custom code.
While similar functions are supported, some changes are necessary to use the new chainable functions in the custom shipping code.
// Existing FC.customLiveShipping.add(300, 4.99, 'PostBox', 'Local Delivery'); // New rates.add(10300, 4.99, 'PostBox', 'Local Delivery'); // Existing FC.customLiveShipping.hide('all'); FC.customLiveShipping.hide('FedEx'); // New rates.hide(); rates.filter('FedEx').hide(); // Existing FC.customLiveShipping.show('all'); FC.customLiveShipping.show('FedEx'); // New rates.show(); rates.filter('FedEx').show(); // Existing FC.customLiveShipping.update('all', '*2'); FC.customLiveShipping.update('Overnight', '+5'); FC.customLiveShipping.update('USPS Ground', null, null, 'Super Saver'); // New rates.price('*2'); rates.filter('Overnight').price('+5'); rates.filter('USPS Ground').service('Super Saver'); // Existing FC.customLiveShipping.remove('all'); FC.customLiveShipping.remove('FedEx'); // New // Replaced with hide() // Existing FC.customLiveShipping.reset(); // New rates.reset();
For details on how to access information about the customers address and cart, view the examples on the custom shipping code wiki page.
BEGIN CUSTOM SHIPPING LOGIC and END CUSTOM SHIPPING LOGIC lines to work with the new custom shipping code's javascript API.This was a very common snippet which added the ability to specify custom flat rates for your store - whether that was a single cost you wanted to apply across the whole store, a specific cost based on the country of the customer, or multiple different rates based on varying conditions.
While similar functions are supported, some changes are necessary to use the new chainable functions in the custom shipping code.
// Existing FC.customFlatRates.add(100, 4.99, 'PostBox', 'Local Delivery'); // New rates.add(10100, 4.99, 'PostBox', 'Local Delivery'); // Existing FC.customFlatRates.hide('all'); FC.customFlatRates.hide('FedEx'); // New rates.hide(); rates.filter('FedEx').hide(); // Existing FC.customFlatRates.show('all'); FC.customFlatRates.show('FedEx'); // New rates.show(); rates.filter('FedEx').show(); // Existing FC.customFlatRates.update('all', '*2'); FC.customFlatRates.update('Overnight', '+5'); FC.customFlatRates.update('USPS Ground', null, null, 'Super Saver'); // New rates.price('*2'); rates.filter('Overnight').price('+5'); rates.filter('USPS Ground').service('Super Saver'); // Existing FC.customFlatRates.remove('all'); FC.customFlatRates.remove('FedEx'); // New // Replaced with hide() // Existing FC.customFlatRates.reset(); // New rates.reset(); // Existing FC.customFlatRates.error('Sorry, we can\'t ship to Canada'); // New rates.error('Sorry, we can\t' ship to Canada');
For details on how to access information about the customers address and cart, view the examples on the custom shipping code wiki page.
BEGIN CUSTOM SHIPPING LOGIC and END CUSTOM SHIPPING LOGIC lines to work with the new custom shipping code's javascript API.If you don't want to have the “weight” parameter shown for your products in the cart, this can be hidden from customers using an option found on the “configuration” page of your store's Foxy administration. Enable the option labelled “Customize Cart Display” and uncheck the option for “Show Product Weight”. Saving the updated configuration will hide the weight from the customer.
This is just a basic snippet that removes the “1-Day” and “2-Day” strings from USPS rate descriptions.
If your store had heavier products, this snippet is commonly used to break up orders into smaller packages to allow rates to be returned, before multiplying the rates by the number of packages.
This snippet also makes use of the Live Rate Shipping Modification snippet - but if all you're doing is accounting for the number of packages, and not making any other changes - you can use another new feature that was added recently.
To confirm that, review your custom snippet, and ensure that all that you are doing within the BEGIN CUSTOM SHIPPING LOGIC and END CUSTOM SHIPPING LOGIC lines is this:
FC.customLiveShipping.update('all', '*' + FC.customLiveShipping.custom_packages);
If there is other customLiveShipping calls you're making, you'll also need to review the migration notes for the Live Rate Shipping Modification snippet as detailed earlier on this page, in combination with the below.
To remove the overweight packages snippet:
For more details on this new “max package weight” setting, check out this page.