Skip to content

Commit

Permalink
Merge branch 'develop' into fix/8141-fraud-prevention-token-site-edit…
Browse files Browse the repository at this point in the history
…or-problem
  • Loading branch information
tpaksu authored Feb 13, 2024
2 parents 97eac27 + 55b3d52 commit e706cd7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
5 changes: 5 additions & 0 deletions changelog/7695-readd-variation-product-type
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Adding back a product type that was mistakenly removed.


4 changes: 4 additions & 0 deletions changelog/fix-open-email-input-iframe-when-no-wcpay
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Do not open the email input iframe without wcpay payment method
16 changes: 11 additions & 5 deletions client/checkout/woopay/email-input-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
validateEmail,
appendRedirectionParams,
} from './utils';
import { select } from '@wordpress/data';

export const handleWooPayEmailInput = async (
field,
Expand Down Expand Up @@ -608,11 +609,16 @@ export const handleWooPayEmailInput = async (
} );

if ( ! customerClickedBackButton ) {
// Check if user already has a WooPay login session.
if (
! hasCheckedLoginSession &&
! getConfig( 'isWooPayDirectCheckoutEnabled' )
) {
const paymentMethods = await select(
'wc/store/payment'
).getAvailablePaymentMethods();

const hasWCPayPaymentMethod = paymentMethods.hasOwnProperty(
'woocommerce_payments'
);

// Check if user already has a WooPay login session and only open the iframe if there is WCPay.
if ( ! hasCheckedLoginSession && hasWCPayPaymentMethod ) {
openLoginSessionIframe( woopayEmailInput.value );
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function ajax_add_to_cart() {
WC()->cart->add_to_cart( $product->get_id(), $quantity, $variation_id, $attributes );
}

if ( in_array( $product_type, [ 'simple', 'subscription', 'subscription_variation', 'bundle', 'mix-and-match' ], true ) ) {
if ( in_array( $product_type, [ 'simple', 'variation', 'subscription', 'subscription_variation', 'bundle', 'mix-and-match' ], true ) ) {
WC()->cart->add_to_cart( $product->get_id(), $quantity );
}

Expand Down

0 comments on commit e706cd7

Please sign in to comment.