Skip to content

Instantly share code, notes, and snippets.

View riotxoa's full-sized avatar

Ricardo Otxoa riotxoa

View GitHub Profile
@riotxoa
riotxoa / functions.php
Created August 28, 2018 07:57
WooCommerce Coupons Fix: email restrictions
/*
WooCommerce email restriction for coupons does not work. This fix corrects it.
Include this code snippet in your theme or plugin.
*/
add_filter( 'woocommerce_coupon_is_valid', 'wc_riotxoa_coupon_is_valid', 10, 2 );
if ( ! function_exists( 'wc_riotxoa_coupon_is_valid' ) ) {
function wc_riotxoa_coupon_is_valid( $result, $coupon ) {