Show/Hide Free Shipping Based on Item Count for Domestic Shipment

One of our customers who buy 12 or more comic books.

We created a code snippet as below that enables to show/hide Free Shipping based on item count for domestic shipment:

In the above code, alter the number in the variable ($minimum_number_of_item = 12;) to offer free shipping.

Also alter the variable for country code ($shop_country = ‘AU’;) as applicable.

Here are two screenshots to show how the snippet works:

Screenshot 1: Cart with less than 12 items

Screenshot 2: Cart with more than 12 items