What's your biggest current challenge? Have your say in Community Polls along the right column.

Can a product variant be linked to another product in the store?

Can a product variant be linked to another product in the store?

mbmperformance
Visitor
1 0 0

Hi,

Is it possible to link a variant of a product to another product in the store? I have my ERP system feeding my store and would like the variant to be linked with the SKU I have created for that specific variant. I tried entering the desired SKU of the product variant but it did not seem to auto populate pricing or inventory based on the identical SKU from the product already within my store.

Replies 3 (3)

Guleria
Shopify Partner
3692 741 1039

Hello @mbmperformance ,

Create a metafield for the variants from where you can add the target URL for the variant.
Then in the code check if there is a target  URL available for the variant or not. If found, redirect it to the target product URL else default code will work as it is.  

 

Thanks

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder

PaulNewton
Shopify Partner
7450 657 1565

@mbmperformance wrote:

variant to be linked with the SKU ...  auto populate pricing or inventory based on the identical SKU from the product


Shopify is not a sku centric system treating a SKU as a source of truth;   it only may inform you of duplicate skus but also does not validate or restrict skus. You would need external software integrating with shopify to do such a thing.

 


@mbmperformance wrote:

 link a variant of a product to another product 


This can be interpreted different ways:

  • just show a link to a specific other product when a variant is selected.
  • when a specific variant is selected on a product page, or card , redirect the user to another products page. aka product-families where each product "variant" is actually it's own standalone product if DIY'ing search the forums for some of my posts about this otherwise contact me.

Implementing the actual UI of this is separate from setting up the data relationships. 

 

For just building the relationship If you have lots of these relationships copy&pasting hardcoded urls will lead to mistakes and be fragile as urls change.

 

Create a metafield definition(mfdf) that directly references a product or a product-variant.

This way when setting up the mfdf in the products/variants admin you can literally search and set the specific prodcut/prodcut-variant.

Though for TONS of relationships you will want to use an a data export/import app to populate the mfdfs values from a spreadsheet; if your ERP is not capable of this that is.

 

Then in code generate the route (full url) to the product/variant through it's handle and any relevant variant.id

 

 

If you need this setup as an example you can contact me by mail for services.
Please always provide context, examples: store url, theme name, post url(s) , or any further detail.
Contact Info in signature.

 

 

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


GetAllTool
Shopify Partner
36 0 7

You might consider linking multiple products through the LinkedOption Combined Listings app and displaying these products as variants on your product page!