'desc'=>'Test multiple coupons. One coupon has limit up to 5 item. Discounting sequentially. Multiple zero-dollar items.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'wc_options'=>array(
'woocommerce_calc_discounts_sequentially'=>array(
'set'=>'yes',
'revert'=>'no',
),
),
'cart'=>array(
array(
'price'=>1.80,
'qty'=>3,
),
array(
'price'=>13.95,
'qty'=>3,
),
array(
'price'=>0,
'qty'=>1,
),
array(
'price'=>0,
'qty'=>1,
),
array(
'price'=>0,
'qty'=>1,
),
array(
'price'=>0,
'qty'=>1,
),
array(
'price'=>0,
'qty'=>1,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'percent',
'amount'=>'30',
'limit_usage_to_x_items'=>5,
),
array(
'code'=>'test1',
'discount_type'=>'percent',
'amount'=>'20',
),
),
'expected_total_discount'=>20.35,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on one item.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'10',
),
),
'expected_total_discount'=>30,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on one item. Coupon greater than item cost.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'20',
),
),
'expected_total_discount'=>41.85,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on one item. Limit to one item.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'10',
'limit_usage_to_x_items'=>1,
),
),
'expected_total_discount'=>10,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on one item. Limit to one item. Price greater than product.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'15',
'limit_usage_to_x_items'=>1,
),
),
'expected_total_discount'=>13.95,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on one item. Limit to same number of items as product. Price same as product.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'13.95',
'limit_usage_to_x_items'=>3,
),
),
'expected_total_discount'=>41.85,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on two items. No limit.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
array(
'price'=>1.80,
'qty'=>5,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'10',
),
),
'expected_total_discount'=>39,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on two items. Limit to same number of items as first product.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
array(
'price'=>1.80,
'qty'=>5,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'10',
'limit_usage_to_x_items'=>3,
),
),
'expected_total_discount'=>30,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on two items. Limit to number greater than first product but less than total quantities.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
array(
'price'=>1.80,
'qty'=>5,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'10',
'limit_usage_to_x_items'=>5,
),
),
'expected_total_discount'=>33.60,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on two items. Limit to number greater than first product but less than total quantities. Amount less than price of either product.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
array(
'price'=>1.80,
'qty'=>5,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'1',
'limit_usage_to_x_items'=>5,
),
),
'expected_total_discount'=>5,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on two items. Limit to number greater than both product quantities combined. Amount less than price of either product.',
'tax_rate'=>array(
'tax_rate_country'=>'',
'tax_rate_state'=>'',
'tax_rate'=>'20.0000',
'tax_rate_name'=>'VAT',
'tax_rate_priority'=>'1',
'tax_rate_compound'=>'0',
'tax_rate_shipping'=>'1',
'tax_rate_order'=>'1',
'tax_rate_class'=>'',
),
'prices_include_tax'=>false,
'cart'=>array(
array(
'price'=>13.95,
'qty'=>3,
),
array(
'price'=>1.80,
'qty'=>5,
),
),
'coupons'=>array(
array(
'code'=>'test',
'discount_type'=>'fixed_product',
'amount'=>'1',
'limit_usage_to_x_items'=>10,
),
),
'expected_total_discount'=>8,
),
),
array(
array(
'desc'=>'Test single fixed product coupon on two items. Limit to two items. Testing the products are sorted according to legacy method where first one to apply is the one with greatest price * quantity.',