Shipping classes are a great way to setup different rules and pricing for items in your shop. Usually due to weight or size, some of these items may ship for little or no cost to you. Because of this, shipping class priorities allow you to change the terms based on the highest priority item in the cart.
Using the Per Order Condition
Often when customers are purchasing multiple items, you can fit the smaller items in the same box as the larger items. However, if they order only smaller items, you still need to be compensated for the small box and postage price. In this example, our shop owner manages a boutique that sells dresses and jewelry online. When purchased alone, jewelry will need to ship in a small box. But when purchased with a dress, the two items can ship together, and thus the jewelry ships at a much lower rate.
The key to this working correctly is to use the priorities of the table rows. Rows at the top of the table have the lowest priority, while the bottom rows have the highest. In this scenario, that means Jewelry should be the first row, and Dress should be the last row. Dress has the higher shipping cost and thus the highest priority in this scenario.
In the table of rates below, the shop owner has used their shipping classes to setup the costs for shipping. Jewelry alone will ship in a small box for $4.99. Dresses, however, will ship in a large envelope at $7.95. If the customer orders from both classes, the shipping will remain at $7.95 as the jewelry can be added to same flat rate envelope.
Pay special attention to how the rows for both shipping classes are within the same table. It is important that these rows are together so that the plugin understands that one row is overriding the other. If the rows are split between two tables, the plugin will think these are two options for the customer, and both will be returned.
Using the Per Class Condition
Shipping class priorities also come into play when the Condition setting is set to Per Class. By default, this type of calculation will find a cost for each shipping class in the cart and add them together into one shipping cost. However, enabling the Single Class Only option will allow you to charge the cost of the highest priority class in the cart. It is similar to the example above using the Per Order condition. However, it allows you to set additional criteria on just that group of items rather than the entire cart.
For more information on why this might be useful and to view an example, please read Single Class Only Option.