woocommerce_new_coupon

woocommerce_new_coupon

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

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_new_coupon') is found 3 times:

  • /includes/data-stores/class-wc-coupon-data-store-cpt.php line 99
    			$this->update_post_meta( $coupon );
    			$coupon->save_meta_data();
    			$coupon->apply_changes();
    			delete_transient( 'rest_api_coupons_type_count' );
    			do_action( 'woocommerce_new_coupon', $coupon_id, $coupon );
    		}
    	}
    
    	/**
    	 * Method to read a coupon.
    	 *
    
  • /includes/legacy/api/v2/class-wc-api-coupons.php line 300
    			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 ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
    
  • /includes/legacy/api/v3/class-wc-api-coupons.php line 298
    			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 ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );