Skip to content

Commit 8b3ea8d

Browse files
committed
Fix php unit tests
1 parent 3161463 commit 8b3ea8d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

classes/class-wc-connect-nux.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,17 @@ public static function get_banner_type_to_display( $status = array() ) {
291291
$status['should_display_contextual_banner'] = true;
292292
}
293293

294+
// Fallback for non-US stores if contextual banner flag is not set
295+
if ( isset( $status['tos_accepted'] ) && $status['tos_accepted'] &&
296+
( ! isset( $status['should_display_after_cxn_banner'] ) || ! $status['should_display_after_cxn_banner'] ) &&
297+
( ! isset( $status['should_display_contextual_banner'] ) || ! $status['should_display_contextual_banner'] )
298+
) {
299+
$is_us_store = ( isset( $status['store_country'] ) && 'US' === $status['store_country'] );
300+
if ( ! $is_us_store ) {
301+
return 'after_cxn_non_us';
302+
}
303+
}
304+
294305
// Priority 3: Contextual banners (if standard "after connection" is done or was not applicable,
295306
// TOS is accepted, and the contextual flag is set - either previously or by the block above).
296307
if ( isset( $status['should_display_contextual_banner'] ) && $status['should_display_contextual_banner'] ) {

classes/class-wc-connect-options.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static function get_option_names( $type = 'compact' ) {
5151
'predefined_packages',
5252
'shipping_methods_migrated',
5353
'should_display_nux_after_jp_cxn_banner',
54+
'should_display_nux_contextual_banner',
5455
'needs_tax_environment_setup',
5556
'banner_ppec',
5657
);

0 commit comments

Comments
 (0)