There are a number of conditions that determine if a product can be displayed in a certain store view. From the top of my head, I know 3:
- Is the product associated with the website?
- Is the product configured as enabled/active for that website?
- Does the product have a non-empty price field for that store view?
Background is that I have an external search function using a Solr server in the backend. That search function has been altered so that when a product number is entered into the search function and enter is pressed and there is a product matching that product number close to 100% (capitalization is ignored, but otherwise it needs to be a match), then it jumps directly to the product detail page, otherwise a normal search is performed.
Now, it dawned on me that I could in that way find a product that is not visible to the store view (see the conditions above). The result is that the URL is called correctly, but results in a 404.
Is there a transparent way of testing if a product could theoretically be viewed for a certain store view without finding and spelling out the exhaustive list as it currently is? I imagine something like
would be right on the spot. If spelled out, the conditions in the next version could change, and I would not want to re-check with every update if the list is still complete.