Exclude shipping protection products from home, collection page and related products

Because of Shopify’s shopping cart system, Shipping Protection is created as a digital product in your store. When you enable the Shipping Protection widget, the app automatically generates a Shipping Protection product so it can be added to orders. Since this product is digital, it may appear on your storefront. Below are a few ways you can hide the Shipping Protection product from being displayed on your website.

Hide shipping protection products from home page

Step 1, Go to your Shopify store’s Collections section > Click Create collection

Step 2, fill in "all" in the collection title and select the collection type as "Smart"

Select the condition as "all conditions", then select the product type, select "is not equal to", and select the value as "sam_shipping_protect". Finally, click the "Save" button.

This will exclude shipping protection items from all products.

Hide shipping protection products in specific collections

Go to your Shopify store’s Collections section > Click the corresponding collection

When the condition of the collection is set to "all conditions", the shipping protection products need to meet all conditions to appear in the collection. So you can add another condition, select the product type, select "is not equal to", and select the value "sam_shipping_protect". Finally, click the "Save" button. In this way, the shipping protection products will not appear in the collection.

When the condition of the collection is set to "any condition", the shipping protection product will appear in the collection when it meets any of the conditions. So if you want the shipping protection product not to appear in this type of collection, you need to check and make sure that the shipping protection product does not meet any of the conditions.

If you are using Shopify’s default recommendation system (for example, I am currently using the Dawn theme), you will need to adjust your theme code slightly.

Step 1: Go to Online Store > Theme > Edit Code

Step 2: Find the file that renders related products. (For example, in the Dawn theme, it’s related-products.liquid)

Step 3: Wrap the product items inside the for loop with an {% if recommendation.type != 'sam_protect_shipping' %} ... {% endif %} block to exclude Shipping Protection:

{% for recommendation in recommendations.products %}
  {% if recommendation.type != 'sam_protect_shipping' %} 
    <li class="grid__item">
      {% render 'card-product',
        card_product: recommendation,
        media_aspect_ratio: section.settings.image_ratio,
        image_shape: section.settings.image_shape,
        show_secondary_image: section.settings.show_secondary_image,
        show_vendor: section.settings.show_vendor,
        show_rating: section.settings.show_rating,
        skip_styles: skip_card_product_styles
      %}
    </li>
  {% endif %}
  {%- assign skip_card_product_styles = true -%}
{% endfor %}

After completing this, the Shipping Protection product will no longer appear in the "related products" block on product pages.

Please note that the modification position may vary depending on the theme you are using. If you find it difficult, feel free to contact us and we’ll be happy to assist you:

👉 Chat with us 📧 info@shop-wil.com

Last updated