Hi,
There is an option for that, you don't need to modify anything.
Edit the menu item of that listing in the Joomla menu manager (or via HikaShop > Display > Menus), open the "Products Options" tab and set the option "Waitlist button" to Yes. If the listing comes from a HikaShop products module instead, the same option is in the options of that module.
Two conditions must also be met for the button to actually show on a product of the listing:
- the option "Activate Waitlist feature" in HikaShop > System > Configuration > Features must be on. If you set it to "on a per product basis", the waitlist option must also be turned on in each product
- the product must be out of stock, as the waitlist button replaces the add to cart button