How to configure the Free Shipping option for the order containing a specific product in case cart subtotal reaches a certain threshold?

How to configure the Free Shipping option for the order containing a specific product in case cart subtotal reaches a certain threshold?

As a rule, the Free Shipping delivery option can be configured using the default Magento 2 functionality, in case there are no complex conditions under which it should appear. For example, if you would like to provide free shipping for orders that have reached a $200 threshold, it can be easily specified in the Minimum Order Amount field at Magento admin panel → Stores → Configuration → Sales → Delivery Methods → Free Shipping:




However, if your instance requires a more complex configuration, the standard Free Shipping option won’t be able to handle it.

Let’s say you’d like to allow free shipping only if order subtotal is greater than $100, plus if cart contains a specific product, and the shipping country is Spain. In this case, it is necessary to leave the default Free Shipping delivery method available for all of the orders, like this: 



And hide the Free Shipping method based on the following conditions of a shipping restriction: 



Here is how it is going to look on the frontend:



Note that, if any of the conditions is false, the Free Shipping method won’t be available, because in this example Free Shipping delivery option appears only if all three conditions are fulfilled at the same time:




Moreover, in case the subtotal condition is chosen in the rule, it is essential to configure how it will be calculated at Magento Admin Panel → Stores  Configuration  Amasty Extensions  Shipping Restrictions. There, it is necessary to confirm if you would like to include tax and discounts in the subtotal used for the restriction rule calculations: