More info link for products with "Protection Plan" variants

Hi there,

I need assistance with writing a simple custom code for the product page template that if a product has the variant “Protection Plan”, it automatically displays a hyperlink under the variants section in the product page template.

Store URL: maestrobath.myshopify.com

1 Like

Hi @arminik Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

We are not familiar with your current theme, but if you have a custom liquid block option or a richtext option in your product page, this can be done without having a developer do it for you.

NOTE: Change the “your link” to link of choice.

For Custom block:

Product has the variant "Protection Plan"

For Richtext block, you just to have to add the block and link

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

Hi there,

Thank you for your tip.

However, this is not what I was asking for. The challenge here is that IF the product has a variant called “Protection Plan”, then show a link named “Learn more about the benefits of Protection Plan” under the variants section in the product page template. so only if the product has the variant “Protection Plan” this link to be shown.

If a theme behavior is only for some resources(product,page,collection,etc) use an alternate template that you assign to those sets of products.

https://help.shopify.com/en/manual/online-store/themes/os20/theme-structure/templates#create-a-new-template