Shopify themes, liquid, logos, and UX
Hello Community 🙂
we are using the refresh theme and on the homepage we have added the section: featured collection
how can we add per default additional product info (12 pack) between product name and price? something like this:
this is the preview link: https://fo68e6svg3jpprqu-61049766108.shopifypreview.com
many thanks
@PhMA Please follow below steps to add additional info like 12 pack in product cards. Let me know whether it is helpful for you.
<p>12 pack</p>
{% if template == 'index' %}
<p>12 pack</p>
{% endif %}
@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
so on all the product cards that are part of this collection only: https://matumate.com/collections/bebidas
@Vinsinfo also how can we make the spacing between the name - 12 pack - price -> a bit less? have a bit more narrow
@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 %}
<p id='additional_info'>12 pack cans</p>
{% endif %}
{% endif %}
.card__information #additional_info {
margin: 8px 0px 0px;
font-size: 16px;
line-height: 20px;
}
@Vinsinfo where after which section, code line in card product liquid do I need to add this?
@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.
{% 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 %}
<p id='additional_info'>12 pack cans</p>
{% endif %}
{% endif %}
.card__information #additional_info {
margin: 8px 0px 0px;
font-size: 16px;
line-height: 20px;
}
@Vinsinfo many thanks, I was able to apply it but on this page
copy-of-sobre-matu-mate nuestras bebidas -> there the font size is not adjusting, although it is again linking to the same collections
https://k5dxgyj7e7p6x5ov-61049766108.shopifypreview.com
on all other pages it has the smaller font size like this (it should be like this):
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024