Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Fallback for no products in a product set

Fallback for no products in a product set

andrewhoule
Visitor
1 0 0

I'm using the buybutton JS. I've got product sets rendering just fine when their are products in a collection. However, when a collection is empty, I'm getting a JS 'Not Found' error. How can I suppress that error, and just display a div with something along the lines of "`collection name` products not available at this time" message if no products are in a collection.

I've Googled, til I could Google no more looking for a way to handle that situation. 

How can I hook into the API to check if no products are available, and if no products then display this fallback template?

Thanks in advance!

Replies 0 (0)