Shopify themes, liquid, logos, and UX
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.
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
@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:
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
You might consider linking multiple products through the LinkedOption Combined Listings app and displaying these products as variants on your product page!
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024