The Shipping Rules feature is accessible from the
Shippping Configuration -> Shipping
Rules screen of the Administrator. The purpose of shipping rules is to allow you to create a number of
business rules that can be applied to any of the shipping methods active in the store, for specific SKUs, and for
specific customer delivery locations. Specifically, there are four flavors of shipping rules, which we will
cover in the following sections.
Perhaps the most powerful type of shipping rule is the "Package" shipping rule. The purpose of Package rules is to generate more accurate shipping quotes from the built-in integrations with UPS and USPS. The UPS and USPS processors have the ability to generate shipping rates for shipments that have multiple packages. By creating a set of Package shipping rules, you can define how your products are divided into packages when you ship them. These package definitions can then be made part of the rate request and provide more accurate rates for your customers. The Administrator interface allows you to define the quantities of different products that go into a package, and what the weight and dimensions of each package is. Let's illustrate this with an example.
Example 6.5. Defining Packages with Package Shipping Rules
In this example, let's say we run a store that sells coffee mugs. While many of our customers purchase just one mug when they buy from us, some purchase many more than one, for example, if they need to buy mugs for all the workers in their office. When we stock our mugs, we know that they come to us in boxes of 60 mugs each, and within those big boxes, there are smaller packages of 6 mugs each. If we get an order for 60 mugs, we'll use the big box for the package. If we get an order for 6 mugs, we'll use one of the smaller boxes. For anything that's not a multiple of 6 or 60, we'll ship the remainder in our own packaging. With this knowledge, we can create a set of Package shipping rules to help us provide the most accurate UPS and USPS quotes possible for customers during checkout.
Shippping Configuration -> Shipping Rulesscreen, and click the "Add New Record" button. On the subsequent form, select "Package Size or Weight Rule" for the "Type of Shipping Rule" field. Give your shipping rule a name to help you keep track of it and click the "Add New Record" button to save it.
Shippping Configuration -> Shipping Rulesscreen and click on the "Details" link next to the new rule you created.
Shippping Configuration -> Shipping Rulesscreen and click on the "Details" link next to the new rule you created. Then click the "Rule Ranges" link from the detail page, and the "Add New Record" button to create the first "rule range".
In our example, we'll define a package range for the big 60-mug box that our coffee mugs are packaged in by default. We'll set both the floor and the ceiling at 60. In addition, on this screen we'll enter the corresponding weight and dimensions of the box. After we add a range for the 60-mug box, we'll add another one for the 6-mug box. The result will look like this:
With this setup, if an order comes in for say 75 mugs, the shipping rule processor would create 1 package of weight 40, 2 packages of weight 3.4 lbs., and create another package for the final 3 mugs, using the weight as defined in the product record for the mug. (Anything in the basket that does not fit a package rule would simply be treated as a cumulative total weight package without dimensions, which is how shipping works when no shipping rules are defined.)
The shipping processor tries to fit the most items in a package first and then moves downward. It is important to understand that ONLY 1 package type shipping rule can be applied to a basket line item. Make sure to order your rules appropriately if you set up 2 different rules for SKUs that match the same line item.
The result is a very accurate rate quote from the UPS and USPS processors, because we're able to define with precision exactly how the mugs are shipped.
The UPSShippingProcessor will allow you to override certain global settings within a shipping rule using the pkgExtra 1-5 fields in a package rule range. For example, here are the UPS override fields:
See the global UPS settings for more information on UPS settings.
Another reason for setting up package type rules is to limit shipping methods. In the above example, you might only be able to send the big 40 pound box via UPS Ground. In that case, you can define a method limitation within the "Rule Range" correcponding to the Large Box pacakage. As you create the Rule Range, in addition to defining the weight and dimensions of the large box, you would select "Only allow these methods" as the "Limit Shipping Method Type" field. For the "Limit Shipping Methods" field, you would then enter in "UPSShippingProcessor|02". (02 is the method code for Ground at UPS.) This tells the system to restrict the methods available for customers to select to just UPS Ground.
You can also choose a "Limit Shipping Method Type" of "Allow all but these methods," which would allow everything but certain methods. For example, you could say that you can't ship UPS Express on those items by entering in "UPSShippingProcessor|01" for the "Limit Shipping Methods" field.
In addition to the above examples, you can use wildcards when setting up shipping method limits. For example, you could allow or disallow "UPSShippingProcessor|*", meaning all UPS methods would be disallowed.
The next type of shipping rule you can create are Shipping Discount Rules. This allows you to discount the customer's shipping cost a certain amount based on what SKUs are in the cart, and in what quantities.
Follow the sames steps to create a Shipping Discount Rule as you did for a Package Shipping Rule in the example above, except select "Shipping Discount Rule" as the "Type of Shipping Rule". When you define the "Rule Ranges", instead of identifying a package weight and dimensions, you can define a percentage or fixed discount. If the user's cart contains one or more of the assigned SKUs and meets the quantity range for the "Rule Range", the discount will be applied against the order's shipping cost.
In setting up the "Rule Ranges" for a Shipping Discount Rule, you must enter the shipping methods to apply the discounts to. If a discount would apply to all shipping methods, simply use the wildcard "*|*".
If a Shipping Discount Rule is applicable for user's order, the user is shown the original shipping price and the discount shipping price on the checkout screens when choosing a shipping method. They are also shown the names of any discounts that have been applied. This is a nice way to show the user what is happening. For instance they might see:
Discount: High Quantity Product X Shipping Discount
Original Price: $34.00
The rule processor will apply all possible discounts that match against the shipping totals until those methods hit $0. The user could see multiple discount lines above if multiple discounts were found to match in their basket for that method.
If you setup a discount for a certain SKU that takes 100% off the total shipping price, the user could still be ordering many other things in their basket. The discount comes directly off the *total* shipping amount. So, if you give free shipping when you buy 12 product A's, it will still be free if they also had a bunch of other products in their basket.
The next type of shipping rule you can define are those that limit shipping methods for particular SKUs, independently of any package definitions. Follow the sames steps to create a 'Method Limits by SKU' rule as you did for a Package Shipping Rule in the example above, except select "Method Limit Rule" as the "Type of Shipping Rule". Associate the SKUs you want to restrict methods for, and then create one "Rule Range". Both the floor and the ceiling of the range can be 0, to indicate all quantities. Lastly, enter the method limitations for the range, as described above under Package Shipping Rules.
The last type of shipping rule you can define are those that limit shipping methods not for particular SKUs, but based on the location of the delivery address for the order. Many times, you want to restrict certain methods from appearing to international users, for example, or users outside the continental U.S.
Follow the sames steps to create a 'Method Limits by Location' rule as you did for a Package Shipping Rule in the example above, except select "Method Limit by Location Rule" as the "Type of Shipping Rule". There is no need to associate SKUs with this rule, since the rule is applied independently of what items are in the user's cart. Instead, simply create a "Rule Range" for the rule (in this case "Rule Range" is a bit of a misnomer). For this rule, highlight which countries and states the rule applies to. These are matched against the user's delivery address so that if the user's country or state matches the selected coutry or state, the rule will be applied. Lastly, enter the method limitations for the range, as described above under Package Shipping Rules.
When defining the states and countries for a particular 'Method Limits by Location' rule, keep in mind that the rule will be applied if there is a match on either the state or the country. In other words, if you want a rule to apply just to customers in Alaska and Hawaii, do not select "United States" for the country because that will apply the rule to everyone in the U.S. Leave the country selection alone and just select Alaska and Hawaii from the state selection box.
Some stores selling very large products must ship a single product in multiple packages. For example, for large equipment, the product might need to assembled from multiple parts each of which is packaged and shipped in a separate box. The Shipping Rules function allows for this kind of set up as well. Let's illustrate this with another example.
Example 6.6. Defining Shipping Rules When One Product Is Shipped in Multiple Packages
Shipping Configuration -> Shipping Rules, add a new Shipping Rule whose Type is "Package Size or Weight". Just for reference, give the new rule a code and a name and click the "Add New Record" button to save it.
Shipping Configuration -> Shipping Rules -> Details -> Rule Ranges. In this case, we want to define the package regardless of how many of the product are being sold, so we set the Floor to 1 and the Ceiling to something very high such as 9999999.
With this setup, if an order comes in for the product, the definitions for three packages will be sent to UPS (or USPS) when requesting rates.