Generate CSS if product in shopping cart has specific Tag (editing checkout.liquid)

4 0 1


We have products which are customized and cannot have expedited shipping applied to them.

If these products are in a user's shopping cart we want to hide the "expedited shipping" option at the shipping step of checkout.

I've been attempting to generate CSS if the products are present, but I cannot get it to work on checkout.liquid file.

The below does output CSS when in the cart-template.liquid file:

{% for item in cart.items %}
     {% if item.product.tags contains 'Personalize It' %}
     <style type="text/css">

     /* the content-box__row div is dynamically generated so I cannot add a class to it */

     div.content-box__row:nth-child(2) {



     {% endif %}
{% endfor %}

Any suggestions on how to execute this successfully in the checkout.liquid file?

Thanks. I appreciate your time.

1 Like
Shopify Partner
8396 1123 2937

Hello, @Windsinger 

Welcome to the Shopify community!
and Thanks for your Good question.

sorry for that checkout page customization allow to only Shopify plus plan

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on regarding any help
Shopify Expert | Skype :
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing