Is there a way to edit/call on certain shopify products on the collection page?

Highlighted
New Member
7 0 0

Hello,

I am currently trying to add custom html/css underneath my products on my collection pages. I am adding variant labels to show customers whether a product is sold out or in stock. When trying to link the shopify product/variant by its ID, it applies the css to all of the products. I will link pictures below.

 

Code: Capture.JPG

 

 

Website: Capture.JPG

See? I am only trying to link the first shirt but it is adding it to all of the shirts. Can I further specify what products I want to edit that way each one can have different variants marked out?

0 Likes
Highlighted

You have various possibilities to decide for which products show or not the additional details:

  1. Use Tags
  2. Use Metafields
  3. Define your logic directly inside the template code (not suggested for medium/big catalogs)

 

• If the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
Highlighted
New Member
7 0 0

Which one would be the easiest for expansion as almost all my products will include this code and it must be easy to change when we sell out.

0 Likes
Highlighted

For this type of needs I usually prefer to use always Metafields, and keep Tags for user filtering/sorting and collection conditions.

But maybe you can also implement something smarter without using any of those.

Can you explain better the logic behind? When you want to show the sizes labels? If they just represent the variants available you can implement a for loop on the product and extract the size from the name of the variant.

 

• If the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
0 Likes
Highlighted
New Member
7 0 0

The variant wouldn't be clickable. I am mainly implementing it to show the customer that a certain variant is out of stock. It doesn't need to track inventory or anything. Basically, I just need to be able to say a certain size of a shirt is sold out and I just need a way to link it. Also, I have no expertise in using meta fields and using them to link to products/variants so any help is greatly appreciated.

0 Likes
Highlighted

Hello,

Thank you for your question.

Please share:
- your store URL;
- page URL with the issue you mention;
- storefront password (if your store has one).

I'll help you to the best of my ability.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Needing urgent help? I am currently available for hire, same day response guaranteed: diego.boarutto.fortes@gmail.com
0 Likes
Highlighted
New Member
7 0 0

https://www.primallifting.com/

https://www.primallifting.com/collections/apparel and every other collection we have.

password: Destin200

 

0 Likes
Highlighted

Thanks.

If I understand correctly you want to add the S M etc sizes exclusively to one product and that one product is that tshirt?

If so, what is the link for that tshirt?

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Needing urgent help? I am currently available for hire, same day response guaranteed: diego.boarutto.fortes@gmail.com
0 Likes
Highlighted
New Member
7 0 0

Yes, that way I can say that t-shirt only has XS's and S's available whereas the other 3 might have all sizes available.

0 Likes