Display number of colors under product title on collection page in Dawn theme

bougli
Excursionist
15 0 5

Hi, I'm looking for a code that displays the number of available color options under the product name on the collections page. Please see example image below. Thanks in advance for any help.

 

1000019542.jpg

Replies 3 (3)

topnewyork
Navigator
298 34 45

Hello @bougli,

You want to like this?

topnewyork_0-1716472715738.png


Thanks!

Need a Shopify developer?
Hire us at topnewyorkwebdesign.com
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel
bougli
Excursionist
15 0 5

Hi. Yes, similar to that.

topnewyork
Navigator
298 34 45

Hello @bougli,

First you creat metafield go to setting > custom data > select product > creat metafield name "colorname"

topnewyork_1-1716475333833.png


then go to product select product

topnewyork_2-1716475375446.png


and then type 

topnewyork_3-1716475470827.png

 

go to theme and edit code search file main-collection-product-grid.liquid and paste the code in line no 74
{{ product.metafields.custom.colorname }} 


topnewyork_0-1716475201452.png

Result:

topnewyork_4-1716475602574.png

Thanks!

Need a Shopify developer?
Hire us at topnewyorkwebdesign.com
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel