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

    (@designbymerovingi)

    WooCommerce comes with a large set of actions and filteres that you can use to do custom actions.

    When it comes to purchases, no matter what payment gateway is used, the woocommerce_payment_complete action will fire as an example.

    You could use this hook to award points i.e.:

    add_action( 'woocommerce_payment_complete', 'add_points_for_woo_purchase' );
    function add_points_for_woo_purchase( $order_id ) {
    	if ( ! function_exists( 'mycred_add' ) ) return;
    	mycred_add( 'purchase_reward', get_current_user_id(), 100, 'Points for store purchase' );
    }

    Plugin Author myCred

    (@designbymerovingi)

    You can find more information about WooCommerce actions and filters at https://docs.woothemes.com/document/hooks/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add hooks’ is closed to new replies.