|
@@ 147-149 (lines=3) @@
|
| 144 |
|
$category_ids = $coupon->get_product_categories(); |
| 145 |
|
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' ); |
| 146 |
|
|
| 147 |
|
if ( $categories ) foreach ( $categories as $cat ) { |
| 148 |
|
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>'; |
| 149 |
|
} |
| 150 |
|
?> |
| 151 |
|
</select> <?php echo wc_help_tip( __( 'A product must be in this category for the coupon to remain valid or, for "Product Discounts", products in these categories will be discounted.', 'woocommerce' ) ); ?></p> |
| 152 |
|
<?php |
|
@@ 162-164 (lines=3) @@
|
| 159 |
|
$category_ids = $coupon->get_excluded_product_categories(); |
| 160 |
|
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' ); |
| 161 |
|
|
| 162 |
|
if ( $categories ) foreach ( $categories as $cat ) { |
| 163 |
|
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>'; |
| 164 |
|
} |
| 165 |
|
?> |
| 166 |
|
</select> <?php echo wc_help_tip( __( 'Product must not be in this category for the coupon to remain valid or, for "Product Discounts", products in these categories will not be discounted.', 'woocommerce' ) ); ?></p> |
| 167 |
|
<?php |