← All changes
|
inc/modules/pre-orders/classes/class-pre-orders-rules.php
+2
-2
2.3.0
→
2.3.2
View file →
| @@ -176,9 +176,9 @@ | ||
| 176 | 176 | if ( isset( $taxonomy_map[ $trigger ] ) ) { |
| 177 | 177 | $taxonomy = $taxonomy_map[ $trigger ]; |
| 178 | 178 | $needed_slugs = array(); |
| 179 | 179 | if ( 'category' === $trigger ) { |
| 180 | - $needed_slugs = $rule['category_slugs'] ?? array(); | |
| 180 | + $needed_slugs = merchant_maybe_expand_categories( $rule['category_slugs'] ?? array(), $rule ); | |
| 181 | 181 | } elseif ( 'tags' === $trigger ) { |
| 182 | 182 | $needed_slugs = $rule['tag_slugs'] ?? array(); |
| 183 | 183 | } elseif ( 'brands' === $trigger ) { |
| 184 | 184 | $needed_slugs = $rule['brand_slugs'] ?? array(); |
| @@ -523,9 +523,9 @@ | ||
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | // 2. Exclude Categories |
| 526 | 526 | if ( ! empty( $rule['exclude_categories_toggle'] ) && 'category' !== $trigger ) { |
| 527 | - $slugs = $rule['excluded_categories'] ?? array(); | |
| 527 | + $slugs = merchant_maybe_expand_categories( $rule['excluded_categories'] ?? array(), $rule ); | |
| 528 | 528 | if ( ! empty( $slugs ) && has_term( $slugs, 'product_cat', $_product_id ) ) { |
| 529 | 529 | return true; |
| 530 | 530 | } |
| 531 | 531 | } |