How to Configure Shipping Rules and Shipping Restrictions on Magento 2

Configuring Shipping using Amasty’s Shipping Rules and Shipping Restrictions for Magento 2 When used together, Amasty’s Shipping Rules and Shipping Restrictions for Magento 2 provide flexible configuration options for your shipping rates. Shipping Rules and Restrictions can be based on several factors including product type, weight, price, and customer information such as shipping address or […]

By Luis Amador

Configuring Shipping using Amasty’s Shipping Rules and Shipping Restrictions for Magento 2

Configuring Shipping using Amasty’s Shipping Rules and Shipping Restrictions for Magento 2

When used together, Amasty’s Shipping Rules and Shipping Restrictions for Magento 2 provide flexible configuration options for your shipping rates. Shipping Rules and Restrictions can be based on several factors including product type, weight, price, and customer information such as shipping address or customer attribute. Special shipping rates can also be configured for coupons and other promos.

First, let’s define the difference between a Shipping Rule and Shipping Restriction

Shipping rules override an existing shipping method with a custom shipping rate.
Shipping restrictions (you guessed it) restrict one or more shipping methods based on product, shopping cart or customer attributes.

We are going to set up two different rules / restrictions. The first one will be a rule that overrides the price of Freight shipping to 19% if the order weighs over 150lbs. We will also create a restriction that does not allow Freight shipping to appear on the front end if the order is under 150lbs. The next restriction we will set up is restriction PO Box from Freight and UPS.

To configure Shipping Rules go to Sales > Shipping Rules
To configure Shipping Restrictions go to Sales > Shipping Restrictions

Screen Shot 2016-08-26 at 4.14.56 PM

For this rule, we are going to set up Freight Shipments over 150lbs to be charged 19% of the order total, only for continental United States orders. The minimum shipment cost will be $9.95, the maximum will be $600.

First go to Sales > Shipping Rules and create a new rule.

Screen Shot 2016-07-27 at 12.33.17 PM

Under the General tab, this is where we can name the rule and define which shipping carrier we want the rule applied to. We will enter “USA over 150lb – Ground – 19%” as the Name of the rule. For Shipping Carriers, we will select Freight Shipping because we are going to create a rule to override the price of freight shipping to 19% of the order total.

Screen Shot 2016-07-27 at 12.33.48 PM

Under the Products tab, this is where we define the weight restrictions. This rule will be in effect with items in the cart that equal 150lbs and over.

Screen Shot 2016-07-27 at 12.34.12 PM

Under the Rules tab, we are going to replace the price of freight shipping to 19% of the order total. First you need to change Calculation to Replace and then you can define this in the Percentage per Product section. We will enter 19 in this section.

Screen Shot 2016-07-27 at 12.34.33 PM

In the Address Conditions tab, we will define that we want this rule to only apply to United States orders, not including Hawaii or Alaska.

Screen Shot 2016-07-27 at 12.34.54 PM

If you want this rule setup for specific customer groups or store views, you can define this under Stores and Customer Groups.

We have created the first shipping rule!


Next we want to set up the shipping restrictions to Hide Freight Shipping if order is under 150lbs.

Go to Sales > Shipping Restrictions and create a new restriction.

Screen Shot 2016-07-28 at 11.07.56 AM

Under the Shipping Method tab, let’s define the restriction name to “Hide Freight Shipping Under 150.” We will select Freight Shipping under the Restrict ALL METHODS from Carriers and create an error message to display when this rule doesn’t apply.

Screen Shot 2016-07-28 at 11.08.02 AM

Under the Conditions tab, we will setup the restriction to hide the Freight option if the order is under 150lbs.

Now, Freight will not show up if the order weighs under 150lbs.


The next restriction we want to set up is a PO Box restriction. We do not want to allow customers to have a PO Box address if they are shipping Freight or UPS.

Create a new restriction, Sales > Shipping Restriction Screen Shot 2016-07-28 at 11.05.27 AM

Under the Shipping Methods tab, we are going to name the restriction “No Shipping to PO Boxes” and select Freight and UPS under the Restrict ALL METHODS from Carriers. We also defined an error message that will appear if a customer tries to enter a PO Box while selecting one of these shipping options.

Screen Shot 2016-07-28 at 11.05.33 AM

Under the Conditions tab, put in the condition Address Line contains PO Box. And save the restriction! Now customers will not be able to enter a PO Box if they select Freight or UPS.


Amasty’s Shipping Rules and Shipping Restrictions are a great extension to have on any site. They are super flexible and can be used to create as many rules / restrictions as needed.

For more information about Amasty’s Shipping Rules, click here.

For more information about Amasty’s Shipping Restrictions, click here.

Front End Developer