AXO: Remove restriction for the Force shipping to the customer billing address shipping config

This commit is contained in:
Daniel Dudzic 2024-09-10 19:12:14 +02:00
parent f51dbfc6d3
commit c24b753c38
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
4 changed files with 1 additions and 47 deletions

View file

@ -120,7 +120,6 @@ return array(
'',
array(
$container->get( 'axo.settings-conflict-notice' ),
$container->get( 'axo.shipping-config-notice' ),
$container->get( 'axo.checkout-config-notice' ),
$container->get( 'axo.incompatible-plugins-notice' ),
)

View file

@ -180,13 +180,6 @@ return array(
return $settings_notice_generator->generate_checkout_notice();
},
'axo.shipping-config-notice' => static function ( ContainerInterface $container ) : string {
$settings_notice_generator = $container->get( 'axo.helpers.settings-notice-generator' );
assert( $settings_notice_generator instanceof SettingsNoticeGenerator );
return $settings_notice_generator->generate_shipping_notice();
},
'axo.incompatible-plugins-notice' => static function ( ContainerInterface $container ) : string {
$settings_notice_generator = $container->get( 'axo.helpers.settings-notice-generator' );
assert( $settings_notice_generator instanceof SettingsNoticeGenerator );

View file

@ -99,10 +99,6 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
return $methods;
}
if ( ! $this->is_compatible_shipping_config() ) {
return $methods;
}
$methods[] = $gateway;
return $methods;
},
@ -173,7 +169,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
|| ! $c->get( 'axo.eligible' )
|| 'continuation' === $c->get( 'button.context' )
|| $subscription_helper->cart_contains_subscription()
|| ! $this->is_compatible_shipping_config() ) {
) {
return;
}
@ -357,7 +353,6 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
return ! is_user_logged_in()
&& CartCheckoutDetector::has_classic_checkout()
&& $this->is_compatible_shipping_config()
&& $is_axo_enabled
&& $is_dcc_enabled
&& ! $this->is_excluded_endpoint();
@ -414,15 +409,6 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
return is_wc_endpoint_url( 'order-pay' );
}
/**
* Condition to evaluate if the shipping configuration is compatible.
*
* @return bool
*/
private function is_compatible_shipping_config(): bool {
return ! wc_shipping_enabled() || ( wc_shipping_enabled() && ! wc_ship_to_billing_address_only() );
}
/**
* Outputs a meta tag to allow feature detection on certain pages.
*

View file

@ -103,30 +103,6 @@ class SettingsNoticeGenerator {
return $notice_content ? '<div class="ppcp-notice ppcp-notice-error"><p>' . $notice_content . '</p></div>' : '';
}
/**
* Generates the shipping notice.
*
* @return string
*/
public function generate_shipping_notice(): string {
$shipping_settings_link = admin_url( 'admin.php?page=wc-settings&tab=shipping&section=options' );
$notice_content = '';
if ( wc_shipping_enabled() && wc_ship_to_billing_address_only() ) {
$notice_content = sprintf(
/* translators: %1$s: URL to the Shipping destination settings page. */
__(
'<span class="highlight">Warning:</span> The <a href="%1$s">Shipping destination</a> of your store is currently configured to <code>Force shipping to the customer billing address</code>. To enable Fastlane and accelerate payments, the shipping destination must be configured either to <code>Default to customer shipping address</code> or <code>Default to customer billing address</code> so buyers can set separate billing and shipping details.',
'woocommerce-paypal-payments'
),
esc_url( $shipping_settings_link )
);
}
return $notice_content ? '<div class="ppcp-notice ppcp-notice-error"><p>' . $notice_content . '</p></div>' : '';
}
/**
* Generates the incompatible plugins notice.
*