I'm adding a new field in the Usage Restriction tab in the coupon single page of WooCommerce. The newly added field is being displayed at the bottom of the tab. I want it to be displayed before the exclude products field.
I'm using the woocommerce_coupon_options_usage_restriction
action hook to add the new field and the following function to add a new checkbox:
woocommerce_wp_checkbox(
[
'id' => 'apply_cart_condition_for_customer_on_products',
'label' => esc_html__( 'Product Cart Condition', 'hexcoupon' ),
'description' => esc_html__( 'Check this box to to add a cart condition for the customer based on product.', 'hexcoupon' ),
'value' => $apply_cart_condition_on_products,
]
);
So I want this checkbox before the default exclude product field. I can't find a way to do that. I Need your help.
I looked into the file 'class-wc-meta-box-coupon-data.php' of woocommerce to see if there is any clue. But, I didn't find anything there.