Hello,
I'm sorry if my suggestions were not viable solution for your issue, it wasn't specified that the error message should have bean displayed just after clicking on the add to cart button.
A good solution can be to directly develop a plugin based on the "onBeforeCartSave(&$element,&$do)" trigger, and cancel the add to cart action if your user already purchased that product and display your error message.
For more information about that trigger, you can check our developer documentation :
This method will be called by HikaShop before the cart is saved, when a product is added, removed, modified, when a shipping or payment method is selected, etc. In the object $element, you can have an attribute cart_products which is an array of products to be added/modified. You can use the variable $do to cancel the save.
www.hikashop.com/support/documentation/6...umentation.html#cart
Kind regards,
Mohamed Thelji