Product Icon

Smart Coupons for WooCommerce

Advanced discount rules, gift cards, BOGO deals, store credits, dynamic pricing, bulk coupon codes, URL coupons and more with this all-in-one Smart Coupons for WooCommerce plugin.

Coupon Valid on Days

This feature would be awesome for stores that have a special offer on set days of week.

Like JustEat have a Two for Tuesday promo, many stores may find this a handy Feature

Here is an example on how i envision it, Please enjoy the code.

// Add valid days checkboxes to the coupon admin page
add_action( ‘woocommerce_coupon_options’, ‘add_valid_days_field_to_coupon’ );
function add_valid_days_field_to_coupon() {
$days_of_week = [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’, ‘Sunday’];
$valid_days = get_post_meta( get_the_ID(), ‘valid_days’, true );
if ( ! is_array( $valid_days ) ) {
$valid_days = [];
}
?>

<input type="checkbox" name="valid_days[]" value="”
/>

Author

ukcandybox

Current Status

Open

Last updated: October 24, 2024

0 comments

Log in to comment on this feature request.