Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Specific variants on collection pages

Specific variants on collection pages

jknupp
Tourist
5 1 1

Hi all,

 

I run a store for my wife, an author and I have a question/issue I'm running into around product variants on collection pages.

 

Here's the situation.

 

My wife (as I mentioned) is an author.  She writes books.  Each book has multiple variants (that equate to formats): ebook, audiobook, paperback, large print, special edition.

 

Books are set up as products and each book/product has the different variants.

 

I'm trying to figure out how to set up a collection/page that will only display a specific variant on that page.  For example there is an "audiobooks" page that is just a collection.  I'd like to display only the audiobook variants on that page for each product that has an audiobook variant (and not the others..ebook, paperback...etc).  Right now, this page displays the "main image" of the product and a "choose" option button (because there are multiple variants to pick from).  So it's displaying the "product". 

 

Is there a way to create a collection and have the collection page ONLY display the desired variant and associated image, price, info, etc? 

 

Ideally I'd like to do this without an app for speed reasons.  But I'm open to apps.  The problem is that while I have found apps that get close, they all seems to want want to display ALL variants on collection pages as products. There is no way to say only "x" variant. I want to only display specific variants on collection pages as products. 

 

I know I could do this as individual products but that seems completely counter intuitive.

 

Thanks for any help.

 

-J

Replies 2 (2)

yy0z
Shopify Partner
87 6 13

There are a couple of ways I think it could work, it depends how your products are currently set up, if they are all set up exactly the same way.

For example, if all the book types are set up the same way, then you can add an extra logic in liquid when you loop through the collection page to only show that variant if for example the type/name of that variant = "audio". This can be done if your variant options are set up exactly the same across all products.

If they are not set up the same way, then you need to either amend that so they are all the same or you can set up metafields in variants (if you have shopify 2.0 themes), and again loop through the variants in collection page using that information. 

 

I think it can be done without an app, but implementation depends on what theme you have. 

Jahid-KlinKode
Excursionist
145 1 5

Hi @jknupp, follow the steps outlined in this YouTube video to add variant names and prices to your Shopify collection pages.