Signup

​How to display "Pickup Only" tags on the cart page

TABLE OF CONTENTS

Why you should add "Pickup Only" tags to the cart page

If you have some products configured to be "Pickup Only", it can be confusing for customers on the cart page to determine which product is not available for pickup. This solution will add a "Pickup Only" tag to product on the cart page as shown below :

How to add a tag to a product

To add a "Pickup Only" tag to a product, go to the products section within Shopify, open a product and add a "Pickup Only" tag as shown below :

How to display the tag on the cart page

Once you have added the "Pickup Only" tag to the required products, you are ready to add the snippet of code to the cart.liquid/cart-template.liquid file.

Here's how to do this :

1. Go to the themes section within Shopify

2. Edit the theme you are working on

3. Locate the cart.liquid or cart-template.liquid file.

4. Add the following snippet of code between the sections related to item quantity and item price :

{% if item.product.tags contains "Pickup Only" %}
    <p style="color:red;text-align:center;"><strong>Pickup Only</strong></p>
    {% endif %}

Note :

It may take some trial and error to find the optimal position to place this snippet of code depending on your theme, if you need any assistance with the positioning of this code please contact us at [email protected].

How to display "Delivery Only"/"Shipping Only" tags on the cart

We can use the same method to add "Delivery Only" and "Shipping Only" tags to products available for delivery or shipping only.

To add the corresponding tag to each type of product on the cart page (pickup/delivery/shipping only) you would use the same method outlined above however you would use the following code snippet :

{% if item.product.tags contains "Pickup Only" %}
    <p style="color:red;text-align:center;"><strong>Pickup Only</strong></p>
    {% endif %}
{% if item.product.tags contains "Delivery Only" %}
    <p style="color:red;text-align:center;"><strong>Delivery Only</strong></p>
    {% endif %}
{% if item.product.tags contains "Shipping Only" %}
    <p style="color:red;text-align:center;"><strong>Shipping Only</strong></p>
    {% endif %}


R
Ronan is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.