1 <?php
2 3 4 5 6 7 8 9 10 11
12
13 if ( ! defined( 'ABSPATH' ) ) exit;
14
15 16 17 18 19
20 function wc_get_coupon_types() {
21 return (array) apply_filters( 'woocommerce_coupon_discount_types', array(
22 'fixed_cart' => __( 'Cart Discount', 'woocommerce' ),
23 'percent' => __( 'Cart % Discount', 'woocommerce' ),
24 'fixed_product' => __( 'Product Discount', 'woocommerce' ),
25 'percent_product' => __( 'Product % Discount', 'woocommerce' )
26 ) );
27 }
28
29 30 31 32 33 34
35 function wc_get_coupon_type( $type = '' ) {
36 $types = wc_get_coupon_types();
37 if ( isset( $types[ $type ] ) )
38 return $types[ $type ];
39
40 return '';
41 }
42