Hook WooCommerce message on archive/category page
-
Hi there,
So, all the stores’ products in my website are listed in the archive page, whether it is simple product or variable product. I would like when the customer clicks the “add to cart” button which available on every product, it shows a notification that the product has been added to cart. I’ve managed to have the “add to cart” button on every product and also have able to show notification for the simple product.
Now I was wondering if variable product can do this as well. I tried to add some filter using the hook on WooCommerce but I supposed it only hooked to the first product in the page. Example, if I have 2 variable products on the same archive page, the hook will only works on the first product. While the second product hook will take place on the first product hook.
For better example, my website link: https://taleofnightingales.com/collection/
The first product and fourth product on the list are variable product. If I add the first product, it works fine but when I try to add the other one, the notification “add to basket” shows up on the first product div.I really appreciate any idea to solve this issue.
Thank you,
Cheers
- The topic ‘Hook WooCommerce message on archive/category page’ is closed to new replies.