Executing JS on add_to_cart() action

i’ve been trying for a while now to have some JS executed when the User Adds an item to his cart, i noticed that when the user is on the single product page, the action woocommerce_add_to_cart gets fired and it executes my Javascript but when using the AddToCart button on the products list ( page with all products) the action doesnt work, anyone knows what i can do to make it work?
Also I would like to execute some Javascript when an Order is completed, tried both woocommerce_order_status_completed and woocommerce_payment_complete hooks but none of them executed the script ( i want the script to be executed exactly after the user submits an order)

Thanks !

Read more here: Executing JS on add_to_cart() action

Leave a Reply

Your email address will not be published. Required fields are marked *