how to add the size option in product card right top bar.

how to add the size option in product card right top bar.

ErSanjay
Shopify Partner
321 20 47

Hi everyone,

I'm working on improving the layout of our product cards on our Shopify store, and I want to add size options to the top right corner of each card.

I’ve implemented a feature that dynamically displays the available size options based on the product variants, ensuring that sizes labeled as "Material" are excluded.




ErSanjay_0-1727508698200.png

 

Business Owner & Shopify Plus, Shopify app , Shopify Consultant - Full Stack Sofware Engineer
Warm regards,
Er Sanjay

If you find yourself in need of assistance with your store, don't hesitate to reach out! Feel free to send me a direct message, and I'll do my best to help you out.
Reply 1 (1)

asisnaira
Visitor
3 0 0

@ErSanjaynjmc wrote:

Hi everyone,

I'm working on improving the layout of our product cards on our Shopify store, and I want to add size options to the top right corner of each card.

I’ve implemented a feature that dynamically displays the available size options based on the product variants, ensuring that sizes labeled as "Material" are excluded.




ErSanjay_0-1727508698200.png

 


To add size options to the top right corner of your product cards in Shopify, you can modify your theme's code. First, access your Shopify admin and go to Online Store > Themes. Click on Actions > Edit code for your active theme. Locate the product card template, typically found in Sections or Snippets.

Within the product card code, you can add a new <div> element positioned at the top right corner using CSS for styling. Use Liquid code to loop through the product variants and display the available sizes, ensuring you filter out any variants labeled as "Material." Hope! it would be helpful.