We're proud to announce the full release of Commerce Shipping 2.0. In recent days, the final pieces have fallen into place to ensure the module accommodates recalculating shipping rates as addresses are entered, fully supporting a dynamic single-page checkout form. We also tested and retested the upgrade path from Commerce Shipping 1.x to ensure no data is lost for orders containing shipping line items from that version.
What's the big deal?
Commerce Shipping 2.0 is a complete rewrite of what the 1.x branch offered. It subdivides shipping methods into individual shipping services, giving you granular control over when each individual service from a provider like UPS should be available for an order. For example, you can use USPS for all orders within the U.S.A. and UPS for all other territories while requiring that certain products only ship UPS Next Day Air regardless of where they're shipping to.
Shipping rate calculation has also been improved to function much like the product sell price calculation in the core of Drupal Commerce. When shipping services are calculated for an order, they are represented as line items that have a base rate defined by the shipping method. The line item is then passed through Rules for additional calculation, allowing you to add taxes and handling fees or perform complex calculations based on weight, distance, quantity, etc. to determine the final calculated rate.
These features and the API behind them provide a marked improvement over the shipping solutions we've developed before, including what we've worked on for Ubercart, giving you the utmost flexibility in determining how to calculate shipping for your site. We think that's a big deal.
Shipping method modules already developed
Commerce Shipping 2.0 is released alongside multiple shipping method modules. The most common is the Commerce Flat Rate module that allows you to define any number of flat rate shipping services for sites that only use flat rate shipping, that want to offer a "free shipping" service alongside calculated shipping rates, or that want to use a base rate and then calculate it further based on weight, quantity, value, etc.
We have developers focused on bringing each of these modules to full release status in conjunction with Commerce Shipping 2.0, and even more integrations are in the works. It's a different heading, but this is also a big deal.
Updating from Commerce Shipping 1.x
If you've previously installed Commerce Shipping 1.x and have used it in production, you'll want to ensure you get the update process right to prevent any data from being lost in the update. The full update process is as follows:
- Ensure you're running the latest version of Commerce Shipping 1.x. As of right now, that is Commerce Shipping 1.1.
- Backup your site - particularly the database.
- Disable (but do not uninstall) any shipping method module on your site developed to work with Commerce Shipping 1.x. For example, if you have been using Commerce Shipping Flat Rate, disable that module. You should not disable any of the actual Commerce Shipping modules from this project.
- Replace the entire commerce_shipping module folder with the new Commerce Shipping 2.x module. Do not just copy the new files into the old directory, as the file structure has changed and you won't want to leave outdated files in the directory.
- Run update.php. If you're updating from Commerce Shipping 1.1, you should see a single update function, update 7100. It will begin to process your existing shipping line items in batches of 25 to update them and the orders they're attached to for the new shipping API.
- Uninstall the shipping method modules you disabled in step 3.
- If you were using Commerce Shipping Flat Rate, install instead the Commerce Flat Rate module and rebuild your flat rate shipping services in the new interface.
- Browse to Administration » Configuration » Workflow » Rules. Scan the list for "broken" rules that were created by Commerce Shipping 1.x shipping methods. Feel free to delete these rules after copying any necessary logic from them over to the new shipping method / service rule configurations.
Please note that because of the drastic differences in this module's API and points of integration with Rules, it simply isn't possible to automate the migration of shipping method rules from Commerce Shipping 1.x into Commerce Shipping 2.x. They will have to be manually recreated, so you should run the update in a test site to ensure you can recreate the shipping configurations used by your site post-update.
Additionally, the names of some fields, Rules conditions / actions, and price component types defined by the module have changed. If you have referenced these things from other Views, Rules, or custom code, you must update them when you migrate to Commerce Shipping 2.x.
We fully stand behind the migration and are happy to assist you if you have any difficulties. You can find us in the Commerce Shipping issue queue or in the #drupal-commerce on IRC.
Changes since 7.x-2.0-beta1 (29 commits):
- #1827092 by glennpratt: allow default rules configurations for shipping methods and services to be overridden by moving this module's implementation of hook_default_rules_configuration() up in the execution order.
- #1804510 by rszrama: add hook_commerce_shipping_line_item_new_alter() to allow other modules to add additional data to newly created line items.
- Show the recalculation button even with JS enabled when shipping is required and there are no options, and provide meaningful help text if there are no options but shipping service selection is not required.
- Rebuild default rules and rebuild the menu when modules defining shipping methods or shipping services are enabled.
- #1810692 by cvangysel, rszrama: convert the update path from 1.x to use a batch process, convert price components, and ensure every shipping line item quantity is 1.
- #1801208 by joachim, rszrama: add missing hook documentation to commerce_shipping.api.php.
- Fix the addition of the express upcharge to the example shipping service line item.
- #1800244 by rszrama: prevent a notice encountered when validating a shipping services pane with no shipping options.
- #1698212 by rszrama: clear a notice when merging shipping service details values from a shipping line item into the checkout pane values array.
- #1287124 follow-up by cvangysel, rszrama: update AJAX shipping calculations to work properly with customer profile copying.
- #1287124 by rszrama, andyg5000, googletorp: support automatically recalculating shipping services when customer profile data on the page is fully entered and/or updated.
- #1695864 by rszrama: make Shipping services the default tab for configuring Shipping.
- #1695868 follow-up by rszrama: adding just a bit more detail / examples to the simpler descriptions.
- #1695868 by Bojhan, googletorp: Improve help texts.
- #1674782 by Simon Georges: Fix notice in commerce_shipping_pane_checkout_form()
- #1589088 by googletorp, remove copy address plugin in favor of server-side customer profile copying now in Commerce 1.4.
- #1528406 by mrfelton, rszrama and helior: Fix edge case for shipping fee not being applied
- #1464918 by New Zeal: Fix copy billing address problem
- Proper use of Drupal text placeholders
- #1443434 by googletorp: Fix notice when no shipping methods are enabled.
- #1452322 by fago: automatically apply a shipping rate via Rules
- #1387230 by googletorp, fix parameter naming.
- Bugfix, displaying shipping address when deactivating use same address.
- #1243846 by googletorp, Add a addressfield format for copying billing address.
- #1380822 by googletorp, Don't use empty in write context.
- Improve on upgrade path for 1.x to 2.x.
- #1370772 by googletorp: Update hooks should be run from 1.x.
- #1370772 by atlea: improve the update process from 1.x to 2.x by using the proper new field name, commerce_shipping_service, and hiding the shipping rate cache table in hook_flush_caches() if it has not been installed yet.