Why {{ recommendations.products_count }} returns 0 ? (product recommendations)

MaxDesign
Shopify Expert
186 13 74

Hi,

I have successfully installed the product recommendations on product pages in the past, but this time it's not working as {{ recommendations.products_count }} returns 0. Yet there are multiple products listed in the shop and online.

I have followed this tutorial : https://help.shopify.com/en/themes/development/recommended-products/using-liquid

There are no errors in the console and the dom content is there but empty :

2OHMOK6Rhs.png

What could be the possible reasons behind that? I am a bit clueless right now.

 

Regards,

Reach out to me at admin@maxdesign.expert
Replies 4 (4)

PageFly-Richard
Shopify Partner
4164 935 1586

Hi, I think the mechanism to calculate product recommendations from Shopify is based on your order and your product description. On a product page, they will display other products that frequently brought with the selected product. Let give it another try.

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

MaxDesign
Shopify Expert
186 13 74

Thanks for your help Richard,

Actually I found the problem, which was documented in the "Recommendation logic". The problem is I only had one collection named "page d'accueil" (Home page) and apparently :

 

If the product doesn't have a collection URL, then the recommendation algorithm finds collections that include the product and pulls other products from those instead (excluding collections with handles “all” and “frontpage”)

So the "frontpage" handle was the issue. I created a new collection and populated the products in it and it works now.

Hope that helps anyone else in the future.

Reach out to me at admin@maxdesign.expert
N1ck
Visitor
2 0 3

I tried adding another collection and populate it with the same items. It still didn't work for me. When I make a getJSON request I get an empty products array. However, this works on another website. Any ideas what could I have done wrong or missed out?

nickippolito
Shopify Partner
5 0 2

I'm also having the same issues.  I have many collections and it was working until about a week ago it stopped.

Development Site:
https://coastwoodfurniture.myshopify.com/recommendations/products.json?product_id=7376883384507 

Password: coastwood

 

I reached out to Shopify and then said: 

"Unfortunately, as Support Advisors, our knowledge on APIs is severely limited so we would always recommend that you reach out to our API and SDK forums .

Here, you can ask any questions you want and our team would be much better equipped to assist you with this."

 

No luck yet. ☹️