Remove compat Elementor checkout context

This commit is contained in:
Himad M 2025-08-25 14:42:18 -04:00
parent 3b80ec8333
commit 51cfbfb050
No known key found for this signature in database
GPG key ID: 5FC769E9888A7B98

View file

@ -78,7 +78,6 @@ class CompatModule implements ServiceModule, ExtendingModule, ExecutableModule {
$this->fix_page_builders();
$this->exclude_cache_plugins_js_minification( $c );
$this->set_elementor_checkout_context();
$is_nyp_active = $c->get( 'compat.nyp.is_supported_plugin_version_active' );
if ( $is_nyp_active ) {
@ -435,31 +434,6 @@ class CompatModule implements ServiceModule, ExtendingModule, ExecutableModule {
return ( $parent && $parent->get( 'Name' ) === 'Divi' );
}
/**
* Sets the context for the Elementor checkout page.
*
* @return void
*/
protected function set_elementor_checkout_context(): void {
add_action(
'wp',
function () {
$page_id = get_the_ID();
if ( ! is_numeric( $page_id ) || ! CartCheckoutDetector::has_elementor_checkout( (int) $page_id ) ) {
return;
}
add_filter(
'woocommerce_paypal_payments_context',
function ( string $context ): string {
// Default context.
return ( 'mini-cart' === $context ) ? 'checkout' : $context;
}
);
}
);
}
/**
* Excludes PayPal scripts from being minified by cache plugins.
*