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.
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!
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.