I have been stuck on this for days now and need help! I have a locked down wholesale page on my site for vendors to purchase and I need that information to stay hidden from retail side. The issue is, the products keep popping up in my Related Products section of Product Page on my website, www.tulipcottagequilts.com.
I first tried using the Search and Recovery App to fix it by adding the tag ‘hide_recommender’ to each wholesale item and adding the liquid code to not show those per a tutorial I found, but that didn’t work when I refreshed the site, even though those items weren’t showing as product recommendations in the app or when I am customizing the product template. In fact, none of the recommended products are the same between the app and template verses my live site.
I then tried following another tutorial that has you use the seo.hidden metafield for the wholesale collections, which is a good solution for me since I don’t want wholesale product showing in search engines, either. Setting it up and adding the 1 integer to the wholesale collections pages was easy. The problem I am having is that none of the coding I can find, matches what I am seeing in my Studio theme code so I am probably not doing that step correctly.
Is there any way to get help with exactly what code to use, and where to put it, for studio theme to modify the Liquid code for the Related Products section to add an explicit check for the seo.hidden metafield and filter out any products where its value is 1? As of right now, I have hidden the Related Products section completely until I can get this solved. Luckily I am working off of copies to test the code, not the actual published site. I have been able to figure out most issues, so this is especially frustrating!
You can reach out to me for theme customization services for wholesale processes. CLICK → profile-pic , or this @PaulNewton, on the forums for options to connect.
ALWAYS include context like a post-url in new communications.
The seo.hidden metafield is automatic in adding tags to a themes header and that’s pretty much it.
seo.hidden isn’t magic and wont instruct OTHER apps, or bespoke sections, etc etc etc etc behaviors unless specifically documented by that app or thing
And tutorials aren’t for every theme, themes vary wildly you have to do the development work to exchange features between them.
An alternative is apps like locksmith to gate products but again cross compabaility can be an issue.
Thanks for the suggestions. I have definitely learned that the tutorials don’t always work for my theme. I was able to set the wholesale side up and lock that page with the Easy Wholesale Lock app. I have vendors already using it. Unlisting the items isn’t an option. The whole reason I just moved over to Shopify from Square is because I need more site features than the basic cookie cutter site Square provided. My wholesale customers want to be able to shop my designs and order without having to reach out to me, have me put an order together and invoice them, then they go in and pay it, like I had to do in the past. I needed a smarter solution than that. The issue is, I’ve never had to do any of this stuff because they were so cookie cutter, so every step has been filled with roadblocks. I would prefer to not have to use and pay for yet another app. I am hoping somebody else had the same theme and had figured out a workaround.
I was under impression that Recommendations also honor the seo.hidden MF, but…
Studio is a part of Dawn theme family, so you can look for these solutions too.
Generally, related items are rendered by this code:
So you may change it like this:
{% for recommendation in recommendations.products %}
{% if recommendation.metafields.seo.hidden == 1 %}
{% continue %}
{% endif %}
<li class="grid__item">
{% render . . .
You may want to bump up the number of products to recommend to compensate for skipped ones, or modify this further, but this is a reasonable starting point.
Yes! Everything I read when I went down that extensive rabbit hole said that hiding from SEO also hid from recommendations, so it solved both problems for me. Your code was perfect! It didn’t work when I tried it, but reading your post prompted the thought that becasue I had applied the seo.hidden metafield at the Collection level, it wasn’t in the individual products and maybe that was the problem. Duh! So, I added the metafield to each individual product and bingo! First I added the code under the line, right above the {% render line in the code like you show it. It worked, but it was leaving the spaces blank for the cards it was skipping. I noticed the grid item line was missing from your suggested code so I moved it up a line and put it in this order:
That worked perfectly - I can’t thank you enough! There is 2.5 times retail on my site compared to wholesale, so there should be plenty of products to recommend.
The clue your about to waste a ton of time is being told what you want to here yet no one bothers to link to an actual doc as proof.
If it’s not to be found in the actual docs it’s suspect at worst, fragile at best.
Search does not mean “Related”