woocommerce_api_create_coupon

woocommerce_api_create_coupon

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

do_action('woocommerce_api_create_coupon') is found 2 times:

  • /includes/legacy/api/v2/class-wc-api-coupons.php line 299
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
        update_post_meta( $id, 'minimum_amount', wc_format_decimal( $coupon_data['minimum_amount'] ) );
        update_post_meta( $id, 'maximum_amount', wc_format_decimal( $coupon_data['maximum_amount'] ) );
        update_post_meta( $id, 'customer_email', array_filter( array_map( 'sanitize_email', $coupon_data['customer_emails'] ) ) );
     
        do_action( 'woocommerce_api_create_coupon', $id, $data );
        do_action( 'woocommerce_new_coupon', $id );
     
        $this->server->send_status( 201 );
     
        return $this->get_coupon( $id );
    } catch ( WC_API_Exception $e ) {
  • /includes/legacy/api/v3/class-wc-api-coupons.php line 297
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
        update_post_meta( $id, 'minimum_amount', wc_format_decimal( $coupon_data['minimum_amount'] ) );
        update_post_meta( $id, 'maximum_amount', wc_format_decimal( $coupon_data['maximum_amount'] ) );
        update_post_meta( $id, 'customer_email', array_filter( array_map( 'sanitize_email', $coupon_data['customer_emails'] ) ) );
     
        do_action( 'woocommerce_api_create_coupon', $id, $data );
        do_action( 'woocommerce_new_coupon', $id );
     
        $this->server->send_status( 201 );
     
        return $this->get_coupon( $id );
    } catch ( WC_API_Exception $e ) {