mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
Merge pull request #2281 from woocommerce/PCP-737-pui-gateway-displayed-when-no-checkout-country-selected-for-guest-customer
Disable Pay Upon Invoice if billing/shipping country not set (737)
This commit is contained in:
commit
3ca6e7b125
1 changed files with 4 additions and 4 deletions
|
@ -56,14 +56,14 @@ class PayUponInvoiceHelper {
|
|||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
$billing_country = wc_clean( wp_unslash( $_POST['country'] ?? '' ) );
|
||||
if ( $billing_country && 'DE' !== $billing_country ) {
|
||||
$billing_country = WC()->customer->get_billing_country();
|
||||
if ( empty( $billing_country ) || 'DE' !== $billing_country ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
$shipping_country = wc_clean( wp_unslash( $_POST['s_country'] ?? '' ) );
|
||||
if ( $shipping_country && 'DE' !== $shipping_country ) {
|
||||
$shipping_country = WC()->customer->get_shipping_country();
|
||||
if ( empty( $shipping_country ) || 'DE' !== $shipping_country ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue