Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Enums

DiscountType::getpublic staticWC 1.0

Method of the class: DiscountType{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = DiscountType::get(): EnumType;

DiscountType::get() code WC 10.9.1

public static function get(): EnumType {
	if ( null === self::$instance ) {
		self::$instance = new EnumType(
			array(
				'name'        => 'DiscountType',
				'description' => __( 'The type of discount for a coupon.', 'woocommerce' ),
				'values'      => array(
					'PERCENT'       => array(
						'value'       => DiscountTypeEnum::Percent,
						'description' => __( 'A percentage discount.', 'woocommerce' ),
					),
					'FIXED_CART'    => array(
						'value'       => DiscountTypeEnum::FixedCart,
						'description' => __( 'A fixed amount discount applied to the cart.', 'woocommerce' ),
					),
					'FIXED_PRODUCT' => array(
						'value'       => DiscountTypeEnum::FixedProduct,
						'description' => __( 'A fixed amount discount applied to each eligible product.', 'woocommerce' ),
					),
					'OTHER'         => array(
						'value'       => DiscountTypeEnum::Other,
						'description' => __( 'The discount type is not one of the standard WooCommerce values (e.g. added by a plugin). Inspect raw_discount_type for the underlying value.', 'woocommerce' ),
					),
				),
			)
		);
	}
	return self::$instance;
}