Create multiple many-to-many product relations for music store

Create multiple many-to-many product relations for music store

Rouz
Shopify Partner
6 0 0

Hello all,

As a developer I have an upcoming project for a music store and am currently evaluating if Shopify could be feasible for this use case:

 

Most products are vinyl records. A product can have multiple artists, artists can be featured on multiple products. Same with labels, and 2 other fields. There are 4 many-to-many relations in total with each entity having additional data (like artist_name, artist_image, artist_description) and they have their own landing pages (On the artist landing page you'd see this additional data together with a list of all products from this particular artist).

 

I wonder how I can implement that the user can add this kind of relational data in the Shopify admin and how then this data will be passed to the Frontend for display, search, sort and filtering. Since I am a developer, I will be able to implement it, but I need some guideline, reference or documentation.

Can anyone help me out here, or tell me if this is possible in Shopify at all?

 

PS: here is how multiple artists can be added in the current store (with auto complete). So the UX should be similar
Screenshot-2023-11-28-at-23.55.36.jpg

 

 

 

 

Replies 3 (3)

Liam
Community Manager
3108 340 871

Hi Rouz,

 

Shopify does provide some flexibility with product variants and tags that could be utilized for your use case. However, the native many-to-many relationship feature, and the autocomplete where creating new products/ variants is not directly supported in Shopify.

 

Here's a basic outline of how you can achieve some of your required functionality:

  1. Product Variants: You can use product variants to create different versions of the same product. For example, a vinyl record could have different variants based on the artist. Each variant can have its own SKU, price, inventory, and weight.

  2. Metafields: Shopify allows for additional custom fields via Metafields. You can use Metafields to store extra information, like artist_name, artist_image, artist_description, etc. Metafields and very useful and can be associated with various resources like products, variants, collections, customers, orders, etc. To go even further with custom data, you can work with metaobjects where you define your own store data, and I could see metaobject pages being useful for the artist landing pages you mentioned. 

  3. Apps: There are also various apps available in the Shopify App Store that provide more advanced product relationship features. These apps can allow you to create relations between products, collections, tags, etc.

As for the user experience of adding multiple artists, you may need to build a custom app or find a third-party app that provides this functionality. Shopify's Admin API can be used to create/update products, variants, and metafields programmatically.

Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Rouz
Shopify Partner
6 0 0

Hi Liam,

Thanks a lot for your response 😀
Regarding your suggestions:

1. I don't see how Product Variants could help here. Let's say I have one product (vinyl record) that has three artists and two labels assigned to it. It's the same product, I don't need any variants here.

 

2. Metafields sound interesting and could be helpful. However from what I understood, you could write whatever you like into those fields. It's not bound to an actual relation. Also I think searching, sorting and filtering by metafields (which is critical) will either not be possible or it will very likely not perform well.

3. Can you recommend an APP for our use case?

Regarding the auto-complete feature, we can ignore it for now, because once the architecture for the relationships are set, it will be an easy thing to implement.

Thanks again

Rouz
Shopify Partner
6 0 0

Hi Liam,

 

just following up on our discussion.

 

I guess another option could be to implement a custom Shopify app with a database where the needed relations are being stored. For instance for an artist relation, you'd create an artist table and the product_to_artist pivot table where you store the relations. You could then extend the custom product mask in the admin to allow storing multiple artists relations.

I will figure this out. So far so good.

But what I don't know is how I can retrieve the data in the Frontend? Since filtering and searching is critical, how can this be achieved? The shopify products data somehow needs to be aggregated with data from my custom app.

Does anyone with Shopify development experience know how this can be achieved?