|
@@ 647-651 (lines=5) @@
|
| 644 |
|
$product_cats = wc_get_product_cat_ids( $product->id ); |
| 645 |
|
|
| 646 |
|
// Specific products get the discount |
| 647 |
|
if ( sizeof( $this->product_ids ) > 0 ) { |
| 648 |
|
if ( in_array( $product->id, $this->product_ids ) || ( isset( $product->variation_id ) && in_array( $product->variation_id, $this->product_ids ) ) || in_array( $product->get_parent(), $this->product_ids ) ) { |
| 649 |
|
$valid = true; |
| 650 |
|
} |
| 651 |
|
} |
| 652 |
|
|
| 653 |
|
// Category discounts |
| 654 |
|
if ( sizeof( $this->product_categories ) > 0 ) { |
|
@@ 666-670 (lines=5) @@
|
| 663 |
|
} |
| 664 |
|
|
| 665 |
|
// Specific product ID's excluded from the discount |
| 666 |
|
if ( sizeof( $this->exclude_product_ids ) > 0 ) { |
| 667 |
|
if ( in_array( $product->id, $this->exclude_product_ids ) || ( isset( $product->variation_id ) && in_array( $product->variation_id, $this->exclude_product_ids ) ) || in_array( $product->get_parent(), $this->exclude_product_ids ) ) { |
| 668 |
|
$valid = false; |
| 669 |
|
} |
| 670 |
|
} |
| 671 |
|
|
| 672 |
|
// Specific categories excluded from the discount |
| 673 |
|
if ( sizeof( $this->exclude_product_categories ) > 0 ) { |