How to Set Shipping Restrictions Based on Cart Attributes in Magento 2?

How to Set Shipping Restrictions Based on Cart Attributes in Magento 2?

Magento 2 is a powerful eCommerce platform that offers a wide range of features, including the ability to optimise the Magento 2 shipping process. For an outsider, shipping may seem like a straightforward process. However, it is not the case. There are several things a merchant needs to consider ensuring the shipping process creates value for the store, the customer, and all other stakeholders.

This involves restricting certain shipping methods based on the item’s monetary value, weight, type, or overall cart attributes. This is done to control shipping costs, comply with relevant regulations, and ensure the customer receives the product on time. So, how can a merchant set up all these restrictions? Do they need a Magento 2 Shipping Restrictions extension or configure in-built Magento settings?

This article will discuss the various way through which merchants can set up shipping restrictions based on cart attributes in Magento 2.

What are Cart Attributes?

These refer to a cart’s properties. In the context of eCommerce platforms like Magento 2, cart attributes are helpful in setting up promotions, shipping restrictions, discounts, and more. There are various types of cart attributes, including the weight, value, coupon applied, total value, billing address, payment method, and quantity.

Why Set Shipping Restrictions Based on Cart Attributes?

There are various reasons to implement shipping restrictions based on the cart attributes, including:

Cost Management

When shipping many items or a bulky one, the shipping costs can be quite high. As the store owner, it is your responsibility to determine which shipping carrier is suitable for shipping heavy items. Once you determine the best carrier, you can restrict all others based on the cart weight.

Geographic Limitations

Likewise, when shipping items, it is pertinent to consider the various regulations. For example, certain products may require a specific permit for shipment. Additionally, a shipping carrier may not ship a product beyond a certain location based on its size or weight. In such cases, the merchant should only make available carriers that can fulfil the order. There’s no point in displaying other shipping carriers when they’ll ultimately cancel the order.

Promotions

Suppose you wish to increase the average order value. One of the ways to do so is to offer free shipping when orders are of a certain value e.g. $50 and up. This can compel customers to add more items to the cart in the hopes of getting free shipping.

Product Compliance

In certain cases, products may need specialised packaging. There’s also a possibility that only a handful of carriers have the necessary permit to ship such items. This is usually the case for hazardous materials such as chemicals. Hence, the merchant must restrict all standard shipping methods and only make the authorised ones available.

Default Magento 2 Shipping Configuration Options

By default, Magento 2 offers four shipping methods;
  • Free Shipping
  • Flat Rate
  • Table Rates
  • Carrier-Specific Shipping (UPS, USPS, FedEx)

Restricting Shipping Based on Cart Attributes Using Default Features

Magento 2 does not have a straightforward way to set up shipping restrictions based on the cart attributes. Merchants need to be adept in configuring the cart price rules to set up cart attribute-based shipping restrictions. Again, this method is only useful if the restrictions are straightforward. If you wish to set up complex or multiple restrictions, you’ll need a Magento 2 shipping restrictions extension.

To set up cart price rules, go to the Magento 2 Admin Panel. From there, go to Marketing -> Promotions -> Cart Price Rules.

Next click on ‘Add New Rule’ on the upper right corner. You will now have four different tabs, namely Rule Information, Conditions, Actions and Labels. Refer to our article on ‘How to Set Up Cart Price Rules in Magento 2’ for further information on configuring the settings correctly.

For learning purposes, in the ‘Rule Information’ section, enter a descriptive name for the rule. Set the rule to ‘Active’. Select the ‘Websites’ to which the rule should apply. Next, apply the rule to the customer groups (e.g. wholesale or not logged in).

Under the Conditions section, click on + icon. This will open a new window, allowing you to create a new condition. Suppose we wish to create a condition based on Cart Subtotal. For instance, all orders equal or above $100 qualify for free shipping. To do so, the merchant needs to select the ‘Subtotal’ option. The next step is to set the condition to greater than or equal to 100.

In the Actions section, scroll down until you see the ‘Free Shipping’ dropdown menu. You need to set this option to ‘For Matching Items’. This ensures that customers cannot opt for free shipping unless they meet the subtotal requirement i.e. $100 or above.

The last step is to save the rule by click on ‘Save

Using Magento 2 Shipping Restriction Extension for Advanced Shipping Restrictions

The above method is not ideal if you wish to set up multiple restrictions or want to set up more advanced cart attribute-based restrictions. Therefore, the only logical option is to use an extension such as FME’s Magento 2 Restrict Shipping Method. The below image shows a few restrictions in action.

This extension offers various advanced restrictions such as:
  • Cart Based
  • Product Based
  • Customer Group
  • Store View
  • Individual Customer
  • Billing and Shipping Information
  • Day, Week, or Time of Day

Conclusion

This concludes our article on how to set up restrictions based on cart attributes in Magento 2. While Magento 2 does offer an in-built feature to set up this restriction, it is not user-friendly. Hence, we recommend using an extension such as FME’s Magento 2 Shipping Restrictions. By configuring the restrictions, you can benefit from greater cost control and improved customer satisfaction. We do recommend testing a rule thoroughly to ensure it works as desired and adds value. If you have any questions, reach out to our support team. Thank You.

This blog was created with FME's SEO-friendly blog