Hi,
There is no feature to do that directly.
There are two close features :
- You have the setting "Activate Waitlist feature" which you can turn on to have a waitlist system. In that case, when the stock of a product reaches 0, a button "Add me to the waitlist" will appear on the product page. When clicking on it, the customer will be able to provide his email address. And with the help of the HikaShop cron task and the waitlist plugin, which you can configure via the joomla plugins manager, when the product gets stock back, the user will be automatically notified with an email.
- You have the setting "Display a contact button on the product page". With that setting activated, your products will have a "contact us for more information" button on their page. When clicking on it, the customer will see a contact form and when validating, you'll receive an email with the information the user provided. This form can contain extra fields (like a selector for the reason of the contact request for example), which you can configure via the Display>Custom fields menu.
Now, there is a way to do exactly what you want, but it requires a bit of tinkering:
- First, you could set the "Display a contact button on the product page" setting to "on a per product basis". That way, each product will have its own contact button option when you edit it in the backend.
- Then, in the System>Mass actions menu, you could configure mass actions to run periodically in order to change the value of that per product option based on the stock of the product. You would need 2 mass actions:
1. One with a filter product_quantity != 0 and with an action "update the values" on the "product_contact" column with the value 0
2. One with a filter product_quantity = 0 and with an action "update the values" on the "product_contact" column with the value 1
Doing it like this, the contact button would only appear when the stock reaches 0 and disappear if product is restocked.
Note however that you will have some delay since you'll have to wait for the mass actions to be triggered by the cron task for them to update the products.
Note also that in the "limitations" area of a mass action, it is limited to only processing 500 elements. If you have thousands of products, you would need to increase the limit, but this requires that you server can support loading so many products' data at once...