@ethanfox ,
Use class attribute along with the forloop, doing so the class name will be different for each product. Then you can have different color labels for individual product titles.
For example, color-label-{{ forloop.index }}. Put it inside the for loop where product-grid-card is getting rendered
@ethanfox Hey there -- similar to the above, I'd suggest to use a tag on the product, and then create a class for that tag, that shows the correct colour in the label. Specifically:
Feel free to send your website so we can take a closer look.
@ethanfox
According to TristanKing, you need to add the Tags in your product which you can do easily by going to the Products, and then then at the Bottom Right side entering the tag name for example label-blue.
Then you need to code in the file product-grid, you need to call the tags and then filter if the tag contains label, and then if the condition met, then you can include corresponding class for example, for label-blue, put the class name color-blue.
This what I currently have and it does not work.
{% for tag in product.tags %} {% if tag == "blue-label" %} {% style %} .Product-Title { background-color: #A1C3F5;} {% endstyle %} {% elseif tag == "orange-label" %} {% style %} .Product-Title { background-color: #FF902A;} {% endstyle %} {% endif %} {% endfor %}
@ethanfox which file is that? Please send us a link to your store so we can help further :)
User | Count |
---|---|
23 | |
21 | |
18 | |
16 | |
16 |