Need help adding a custom liquid to product information

Hello all!

So, I’m adding affiliate links to my store. I figured out how to make it work on the individual product page…

But now I’m trying to figure out if there is something I can do on the Collections page.

Is there a way to either

  1. add the affilate button there as well and remove the “sold out” from these items? I guess I can add inventory as long as the button can get figured out to handle the sold out issue.

or 2) remove the button completely from the affiliate listings without removing them from my regular listings?

Again, I do still sell inventory, so I don’t want to get rid of the add to cart from those items.

Alternatively, If all else fails, I guess I could just remove the button from the product cards completely.

Hey @dboyxx ,

Do you need any help that we could do for you?

Hello @dboyxx ,

Yes you can call the affiliate button same like the product page in the collection page.

You need to to find the collection template and implement the same logic as you implement in the the product template.

Regards
Guleria

You can create a metafield for products of type Boolean, meaning true or false. Then populate it with true for all the products that have affiliate links.

We can then check for the truthy value and add an extra button for only the affiliate products and also remove the sale badges from them.

There doesn’t seem to be the ability to add a custum liquid within the Product Grid itself. It only allows to add a new section unfortunately. I know I can turn the Quick Add off.

Maybe there is a way to add it within the custom CSS in the product grid?

Hi @dboyxx,

You have to add same logic/code in the collection page. Find the collection liquid template and implement the same logic as you implement in the the product template.

Regards
eComEmerge Team.