Then paste the below code at the next line of “” like below attached image and then save changes.
If you want to display the additional information in all pages, use code the provided in Solution 1. If you want to display only on the home page, use code the provided in Solution 2. Solution 1: To display “12 pack” additional information in product cards in all the pages.
@Vinsinfo many thanks for your help, but how can I apply it everywhere on the product cards but only the products that are part of the bebidas collection, other product cards from other products should not have this info
@PhMA To display the info only for “bebidas” collection products. Remove the previously shared code and use below code instead of it in the ‘card_product.liquid file’.
{% if card_product.collections %}
{% assign is_bebidas_collection_product = false %}
{% for collection in card_product.collections %}
{% if collection.handle == 'bebidas' %}
{% assign is_bebidas_collection_product = true %}
{% break %}
{% endif %}
{% endfor %}
{% if is_bebidas_collection_product %}
12 pack cans
{% endif %}
{% endif %}
To adjust the spacing, go to ‘base.css’ file and paste the below code in bottom of the file and save changes. Note: You can adjust the spacing as per your need. You can also add font size if you want to adjust the font size.
@PhMA In the same line as we mentioned in the very first comment. We will share the steps again her below, you can also follow it. Let me know whether it is helpful for you. If still it didn’t works, please share the card-product.liquid file.