Coupon doesn’t work for product variations
-
The coupon applying function doesn’t account for variations when checking for validity.
The fix:
Change the$product_id =
line in it’s entirety to these two lines$parent_id = is_callable( array( $product, 'get_parent_id' ) ) ? $product->get_parent_id() : false; $product_id = is_numeric($parent_id) ? $parent_id : (is_callable( array( $product, 'get_id' ) ) ? $product->get_id() : $product->id);
in is_valid_for_product_brand function inside /classes/admin/class-pwb-coupon.php
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Coupon doesn’t work for product variations’ is closed to new replies.