Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, we've already a metafield for 3rd party products which we want to link to. you can think of them as affiliate links , but may just be their products main website
e.g. metafield
product.metafields.custom.affiliatelink
We've created using the Multi theme - a customer product variant that shows up and works, and has a button using the url.
However, on collections there is an add to cart and a price showing.
We'd like to have the add to cart on collections be changed to either go to the product detail page or this 3rd party website with the text changed to maybe "Learn More"
and where one of these items only not showing any pricing,
We've had a look through the template files, but couldn't see where to put in the switch variable.
Also.. Assuming I have to edit the shop files, not sure how best to make it so easy to update the theme.. or if a better way.
Assuming I'll need to add code like:
{% if product.metafields.custom.affiliatelink %}
<a href="{{ product.metafields.custom.affiliatelink }}" class="button">....
{% else %} <button type="submit" name="add">Add to Cart</button> {% endif %}
(the forum changed the code.. but you get the idea)
but can't see where to do that
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025