* Create customer object from user object to fetch emails in try-catch. * Add changefile(s) from automation for the following project(s): woocommerce * 48459 Replace $check_emails array values with user_email. * Update plugins/woocommerce/changelog/48488-48459-coupon-email-restriction-fix Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Mike Jolley <mike.jolley@me.com> Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
This commit is contained in:
parent
00f7420f81
commit
858231c238
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fixed a bug causing account email not to be taken in consideration for coupon validation when a customer has a different billing email set.
|
|
@ -970,7 +970,7 @@ class WC_Discounts {
|
|||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
$check_emails = array( $user->get_billing_email(), $user->get_email() );
|
||||
$check_emails = array( $user->user_email );
|
||||
|
||||
if ( $this->object instanceof WC_Cart ) {
|
||||
$check_emails[] = $this->object->get_customer()->get_billing_email();
|
||||
|
|
Loading…
Reference in New Issue