• Resolved reivax1390

    (@reivax1390)


    Hi,
    I need some help because i would like do something when a product is added to wishlist.

    Precisely,i would like notify vendor when an user added product to his wishlist but i don’t know how detect it in my functions.php

    I prefer avoid to make a trigger in my database on the insert.

    Anyone can help me please ?
    (Sorry for my poor english 🙂 Tanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author templateinvaders

    (@templateinvaders)

    Hi @reivax1390

    You can use tinvwl_product_added hook to run your custom code after product added to a wishlist.

    The sample of a hook:

    add_action( 'tinvwl_product_added', 'tinvwl_after_product_added' );
    
    /**
     * Run custom code on product added to wishlist action.
     * 
     * @param array $data Array of data from action
     */
    function tinvwl_after_product_added( $data ) {
    	
            // You can debug $data array to check what exactly data it contains
    	// $data['product_id']  --- WC Product ID
    	// $data['author'] --- WP User ID
    	// $data['wishlist_id'] --- TI Wishlist ID
    	
    	// Run your code to send a notification to a vendor of the added product 
    
    }
    Thread Starter reivax1390

    (@reivax1390)

    Hi @templateinvaders !
    Thank you so much for your fast answer and your great work

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Hook orr trigger’ is closed to new replies.