Repository Forums Support WooCommerce Extended Coupon Features PRO % Discount + Free Product By Brand Reply To: % Discount + Free Product By Brand

#1750
Soft79
Keymaster

I think the issue is caused by the Brands plugin. They seemed to have missed a change in WC2 -> WC3 causing percent-discounts to fail. Please try this:

Open the file woocommerce-brands/includes/class-wc-brands.php, replace the following lines:

Line #202:
if ( ! is_a( $this_obj, 'WC_Coupon' ) || ! $this_obj->is_type( array( 'fixed_product', 'percent_product' ) ) ) {
replace with:
if ( ! is_a( $this_obj, 'WC_Coupon' ) || ! $this_obj->is_type( array( 'fixed_product', 'percent_product', 'percent' ) ) ) {

Line #318:
if ( $coupon_obj->is_type( array( 'fixed_cart', 'percent' ) ) && $num_items_match_included < sizeof( WC()->cart->get_cart() ) ) {
replace with:
if ( $coupon_obj->is_type( array( 'fixed_cart' ) ) && $num_items_match_included < sizeof( WC()->cart->get_cart() ) ) {

Line #367:
if ( $coupon_obj->is_type( array( 'fixed_cart', 'percent' ) ) && $num_items_match_excluded > 0 ) {
replace with:
if ( $coupon_obj->is_type( array( 'fixed_cart' ) ) && $num_items_match_excluded > 0 ) {

Also, in your coupon disable ‘allow multiplication’. Now all should work as expected. If so, please inform the WooCommerce guys of the issue in the Brands plugin.