From f54451f39c8378570f8ba2d9d3a8d651e3947f57 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 30 May 2022 15:09:41 +0300 Subject: [PATCH] Fix disable-funding when free trial but dcc disabled was sending array values instead of keys --- modules/ppcp-button/src/Assets/SmartButton.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index f15b8c800..c63002c17 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -922,9 +922,9 @@ class SmartButton implements SmartButtonInterface { } if ( $this->is_free_trial_cart() ) { - $all_sources = $this->all_funding_sources; + $all_sources = array_keys( $this->all_funding_sources ); if ( $is_dcc_enabled ) { - $all_sources = array_keys( array_diff_key( $all_sources, array( 'card' => '' ) ) ); + $all_sources = array_diff( $all_sources, array( 'card' ) ); } $disable_funding = $all_sources; }