Customize Featured Collection Section on homepage

Customize Featured Collection Section on homepage

PhMA
Explorer
46 0 6

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:

Screenshot 2024-09-20 at 3.09.38 a.m..png

 

this is the preview link: https://fo68e6svg3jpprqu-61049766108.shopifypreview.com

 

many thanks

 

Replies 8 (8)

Vinsinfo
Shopify Partner
427 143 143

@PhMA Please follow below steps to add additional info like 12 pack in product cards. Let me know whether it is helpful for you.

 
1. From admin go to "Online Store" -> "Themes".
2. Click "Edit code" button from the current theme.
Vinsinfo_0-1726830210684.png

 

3. Go to "card-product.liquid" file.
Vinsinfo_1-1726830215246.png

 

4. Then search "card__heading{% if card_product.featured_media or settings.card_style == 'standard' %} h5{% endif %}" in search bar.
Vinsinfo_2-1726830225013.png

 

5. Then paste the below code at the next line of "</h3>" like below attached image and then save changes.
6. 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.
 

 

<p>12 pack</p>

 

Vinsinfo_3-1726830233786.png

 

 

Solution 2: To display "12 pack" additional information in product cards only on the home page.
 

 

{% if template == 'index' %}
  <p>12 pack</p>
{% endif %}

 

Vinsinfo_4-1726830271092.png

 

 
Result will be like,
Vinsinfo_5-1726830316675.png

 

Please provide your support by click "Like" and "Accepted" if our solution works for you. Thanks for your support.
Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support
PhMA
Explorer
46 0 6

@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

PhMA
Explorer
46 0 6

@Vinsinfo  also how can we make the spacing between the name - 12 pack - price -> a bit less? have a bit more narrow

Vinsinfo
Shopify Partner
427 143 143

@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 %}

 

 
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.

 

.card__information #additional_info {
    margin: 8px 0px 0px;
    font-size: 16px;
    line-height: 20px;
}

 

Vinsinfo_0-1726902727735.png

 

 
Result will be like,
Vinsinfo_0-1726902633817.png

 

 
Please provide your support by click "Like" and "Accepted" if our solution works for you. Thanks for your support.
Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support
PhMA
Explorer
46 0 6

@Vinsinfo  where after which section, code line in card product liquid do I need to add this?

Vinsinfo
Shopify Partner
427 143 143

@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.

 
1. From admin go to "Online Store" -> "Themes".
2. Click "Edit code" button from the current theme.
Vinsinfo_0-1727159774584.png
3. Go to "card-product.liquid" file.
Vinsinfo_1-1727159779344.png
4. Then search "card__heading{% if card_product.featured_media or settings.card_style == 'standard' %} h5{% endif %}" in search bar.
Vinsinfo_2-1727159785171.png

 

5. Then paste the below code at the next line of "</h3>" like below attached image and then save changes.

 

{% 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 %}

 

Vinsinfo_3-1727159795539.png

 

6. Then go to "base.css" and paste the below code in bottom of the file.

 

.card__information #additional_info {
    margin: 8px 0px 0px;
    font-size: 16px;
    line-height: 20px;
}

 

Vinsinfo_4-1727159800825.png

 

 
Result will be like,
Vinsinfo_5-1727159807124.png

 

 
Please provide your support by click "Like" and "Accepted" if our solution works for you. Thanks for your support.
Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support
PhMA
Explorer
46 0 6

@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

Screenshot 2024-09-24 at 9.25.13 p.m..png

https://k5dxgyj7e7p6x5ov-61049766108.shopifypreview.com

 

on all other pages it has the smaller font size like this (it should be like this):

Screenshot 2024-09-24 at 9.25.55 p.m..png

PhMA
Explorer
46 0 6