WC_Coupon_Tracking::track_coupon_updated( WC_Coupon $coupon, Array $updated_props )

Send a Tracks event when a coupon is updated.


Description Description


Parameters Parameters

$coupon

(Required) The coupon that has been updated.

$updated_props

(Required) The props of the coupon that have been updated.


Top ↑

Source Source

File: includes/tracks/events/class-wc-coupon-tracking.php

	public function track_coupon_updated( $coupon, $updated_props ) {
		$properties = array(
			'discount_code'        => $coupon->get_code(),
			'free_shipping'        => $coupon->get_free_shipping(),
			'individual_use'       => $coupon->get_individual_use(),
			'exclude_sale_items'   => $coupon->get_exclude_sale_items(),
			'usage_limits_applied' => 0 < intval( $coupon->get_usage_limit() )
									|| 0 < intval( $coupon->get_usage_limit_per_user() )
									|| 0 < intval( $coupon->get_limit_usage_to_x_items() ),
		);

		WC_Tracks::record_event( 'coupon_updated', $properties );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.