Hide a product

Hello,

We’ve developed an application that automatically adds a product to the shopping cart. However, this product should not be directly accessible by customers. To achieve this, we followed the guide at Shopify SEO Documentation and added the SEO metafield “hidden”. As a result, the product no longer appears in search results but remains visible in the catalog.

The app approval team has instructed us to completely hide this product. They recommended seeking advice on this forum, as they couldn’t provide a solution beyond the guide we’ve already followed.

Can anyone here assist us in resolving this issue?

Best regards

Hey @carduzCents

Hiding from search engines wont prevent customers from adding the item to cart (collections, search, JSON endpoints). Depending on your requirements, consider using a Cart/Checkout Validation Function - for example you could allow customers with a specific tag to purchase particular items, or remove the item from their cart if they don’t meet specific cart criteria.

1 Like

Hello @SBD ,

Thank you for your response. I wanted to clarify: is there truly no viable solution to meet our specific requirement? It appears that with the Validation Function, we can only generate an error message when a certain customer attempts to add the product. However, this doesn’t actually hide the product from their view. Is my understanding correct? If so, are there any alternative methods or workarounds you might suggest?

Thank you for your assistance.

1 Like

Hey @carduzCents

> However, this doesn’t actually hide the product from their view.

That’s right, You’d still need to hide the product on the theme side (remove it from collections, hide it from search with custom liquid). The Function runs the server-side validation.

You could look into only publishing these products to your specific app/channel (screenshot), and then creating a cart with the Storefront API - but this wouldn’t work if you needed to preserve the existing cart.

The most common approach is to hide the product / conditionally show it with liquid - for example if a customer has a specific tag, and then back it up with a Function for the server-side validation.

Hello @SBD ,

Thank you for your suggestion. However, implementing this change would require modifying the liquid template. This modification is not feasible to implement programmatically for all clients who install our app due to certain platform constraints. We value your feedback and are always looking for ways to enhance the functionality of our app within these parameters.

Best regards,

Claudio

1 Like