Hot to Hide Wholesale Products From Search Result

lunahlife
Tourist
9 0 1

Hi Everyone, 

 

Need help please.

Our Wholesale product is showing up in our web page now, under retail product recomendation. Its should be only for wholesaler. Can you please advise how to hide this? All the taging already done correctly. 

Please see attached image (in yellow arrow). Thank you 

Replies 3 (3)
Guleria
Shopify Partner
2782 555 793

Hello @lunahlife ,

 

1) Create a Wholesale Collection:
First, create a collection specifically for your wholesale products. You can do this by going to your Shopify admin panel and navigating to "Products" > "Collections," then clicking the "Create collection" button.

 

2) Tag Wholesale Products:
Tag all the products that you want to be considered wholesale products. You can do this by editing each product's details and adding a specific tag, such as "wholesale."

 

3) 

Modify Your Theme:
To hide wholesale products from search results, you'll likely need to modify your store's theme code. This requires some coding knowledge or the help of a developer. Here's a general idea of what you need to do:

Navigate to "Online Store" > "Themes" in your Shopify admin.

Find and click on the "Actions" button for your active theme, then choose "Edit code."

Locate the search.liquid or search-results.liquid file in the templates section (the exact name may vary depending on your theme).

Edit the code to add a condition that excludes products with the wholesale tag from being displayed in search results. The code might look something like this:

{% for result in search.results %}
  {% unless result.object.tags contains 'wholesale' %}
    <!-- Display search result here -->
  {% endunless %}
{% endfor %}

 

Save the changes to the code.

 

If you're not comfortable modifying your theme code, you might consider using a Shopify app that provides more advanced search customization options.
e.g. Searchanise

 

Thanks

-

Need a Shopify developer? Email: guleriathakur43@gmail.com

,
- Skype: navrocks1
- Try GEMPAGES a great page builder.
gr_trading
Shopify Partner
1380 129 150

You can hide the wholesale product from the search result using metafield settings.

Refer to the below video for the same.

 

 

To remove the product in the recommended section

Use add below code in related-product.liquid

{%liquid
            assign isWholesale = false
            for t in recommendation.tags
              if t contains 'wholesale'
                assign isWholesale = true
              endif
            endfor
%}
          <li class="grid__item"  {% if isWholesale %} style="display:none" {% endif %} data-isWholesale="{{ recommendation.tags }}">

 

Please refer to the screenshot to get the info about line no.

gr_trading_0-1693736783785.png

 

Hope this will help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | YouTube Videos
To support Buy Me a Coffee
WholesaleHelpe
Excursionist
13 0 7

Hello @lunahlife 

You may use the Wholesale Lock Manager app, or look for one up of your choice on the Shopify App Store. You can use this app to hide specific products/ collections from certain customers and give access to the restricted content using Passcodes, Customer-tags, or Login-credentials to the customers of your choice. I’m leaving a link to our FAQ page here so that it may help you get a better understanding of this solution. The reason why I’m recommending an app over a custom code is simply because of the ease of use, our app alongside most of them on the Shopify App Store is plug and play, so that means you don’t need to spend time creating a custom code Lock.

 

I am a customer success specialist at Wholesale Helper. Happy to walk you through too if you’d like a personalized demo. 

 

I hope this helps 🙂

Ahmed Talha

Wholesale Helper
Wholesale Helper Support Team