Hi,
The state field is set to 0 not only for unpublished products, but also :
- for published products with unpublished categories linked to them because a product linked to no published category should not be accessible
- for published products with their access level not set to "all" or if the access level setting doesn't have "public" checked (user group with the id 9) because you don't want a product to be searchable by crawlers if it is not accessible to the public
- for published products that have been trashed (when you delete a product while the "Activate product recovery" setting is turned on in the HikaShop configuration, it will go to the trash and you can either empty the trash or restore the product from it, but the product is not available on the frontend in that case)
- for published products with a stock of zero if you have turned off the "Display out of stock products" setting of the HikaShop configuration page.
These conditions are handled by the code in the function getStateColumn of the file plugins/finder/hikashop/hikashop.php
Regarding the solutions, I would say that, as far as I understand, it is normal that published products with any of these criteria are not available in the smart search results.
If you want to customize the results page, you'll have to add custom PHP code in a view override of the results view of the Smart Search component:
magazine.joomla.org/all-issues/march-202...search-results-pages
This will require a developer to work on it. It's not easy because the developer will first have to load the data of the product, process it, before he can display it in the search results page.
A simpler solution to all of this would be to actually not use the Smart Search, and instead use the filter system of HikaShop:
www.hikashop.com/support/documentation/1...-filter-listing.html
With a text filter, and the HikaShop Filter module, you can have a search mechanism similar to the Smart Search but without its inconvenients:
- The results will display as a normal HikaShop products listing by default, so no customization required
- The results are loaded dynamically, so there is no indexing
It's a bit fiddly to setup but so is Smart Search.