Fix fastlane not displayed in legacy ui for eligible countries

This commit is contained in:
Emili Castells Guasch 2025-08-27 16:16:21 +02:00
parent fad0405178
commit 564eec1ea4
No known key found for this signature in database
2 changed files with 22 additions and 12 deletions

View file

@ -535,7 +535,8 @@ return array(
$container->get( 'wcgateway.helper.dcc-product-status' ),
$container->get( 'wcgateway.settings.status' ),
$container->get( 'wcgateway.current-ppcp-settings-page-id' ),
$container->get( 'api.shop.country' )
$container->get( 'api.shop.country' ),
$container->get( 'axo.eligibility.check' )
);
},
'wcgateway.settings.listener' => static function ( ContainerInterface $container ): SettingsListener {

View file

@ -89,6 +89,13 @@ class SettingsRenderer {
*/
protected $page_id;
/**
* A callable property used to check the eligibility for Fastlane.
*
* @var callable
*/
private $axo_eligibility_check;
/**
* SettingsRenderer constructor.
*
@ -111,20 +118,22 @@ class SettingsRenderer {
DCCProductStatus $dcc_product_status,
SettingsStatus $settings_status,
string $page_id,
string $api_shop_country
string $api_shop_country,
callable $axo_eligibility_check
) {
// This is a legacy settings class, it's correctly relying on the `Status` class.
$this->settings = $settings;
$this->state = $state;
$this->fields = $fields;
$this->dcc_applies = $dcc_applies;
$this->messages_apply = $messages_apply;
$this->dcc_product_status = $dcc_product_status;
$this->settings_status = $settings_status;
$this->page_id = $page_id;
$this->api_shop_country = $api_shop_country;
$this->settings = $settings;
$this->state = $state;
$this->fields = $fields;
$this->dcc_applies = $dcc_applies;
$this->messages_apply = $messages_apply;
$this->dcc_product_status = $dcc_product_status;
$this->settings_status = $settings_status;
$this->page_id = $page_id;
$this->api_shop_country = $api_shop_country;
$this->axo_eligibility_check = $axo_eligibility_check;
}
/**
@ -398,7 +407,7 @@ $data_rows_html
}
if (
in_array( 'axo', $config['requirements'], true )
&& $this->api_shop_country !== 'US'
&& ! ( $this->axo_eligibility_check )()
) {
continue;
}