Hi all,
I’m currently using the following script in my main-product.liquid file to hide the first image of specific products based on the alt text alt=“hide-on-product-page”:
This script works perfectly for hiding the first image on the product page when the alt text is set to hide-on-product-page.
Now, I want to extend the functionality to hide the entire product (not just the image) on the following pages:
-
Cart page
-
Search bar results
-
“You May Also Like” sections
However, I want the product to remain visible on the product page, while the image with the alt=“hide-on-product-page” should continue to be hidden as it currently does.
These products are intended to be shown only on the homepage, so they should be hidden across the mentioned sections but visible on the product page.
Can someone help me modify the script so that it:
-
Hides the entire product (not just the image) on the Cart Page, Search Bar, and “You May Also Like” sections.
-
Ensures the product remains visible only on the product page.
Thanks in advance for your help!