|
@@ 145-147 (lines=3) @@
|
| 142 |
|
$category_ids = (array) get_post_meta( $post->ID, 'product_categories', true ); |
| 143 |
|
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' ); |
| 144 |
|
|
| 145 |
|
if ( $categories ) foreach ( $categories as $cat ) { |
| 146 |
|
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>'; |
| 147 |
|
} |
| 148 |
|
?> |
| 149 |
|
</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> |
| 150 |
|
<?php |
|
@@ 160-162 (lines=3) @@
|
| 157 |
|
$category_ids = (array) get_post_meta( $post->ID, 'exclude_product_categories', true ); |
| 158 |
|
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' ); |
| 159 |
|
|
| 160 |
|
if ( $categories ) foreach ( $categories as $cat ) { |
| 161 |
|
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>'; |
| 162 |
|
} |
| 163 |
|
?> |
| 164 |
|
</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> |
| 165 |
|
<?php |