Merge branch 'issue/21062' of https://github.com/kakshak/woocommerce into kakshak-issue/21062

This commit is contained in:
Rodrigo Primo 2018-08-29 13:27:39 -03:00
commit eee61b7880
1 changed files with 4 additions and 4 deletions

View File

@ -764,12 +764,12 @@ class WC_Discounts {
* @return bool
*/
protected function validate_coupon_sale_items( $coupon ) {
if ( $coupon->get_exclude_sale_items() ) {
$valid = false;
if ( $coupon->get_exclude_sale_items() && 'fixed_product' !== $coupon->get_discount_type() ) {
$valid = true;
foreach ( $this->get_items_to_validate() as $item ) {
if ( $item->product && ! $item->product->is_on_sale() ) {
$valid = true;
if ( $item->product && $item->product->is_on_sale() ) {
$valid = false;
break;
}
}