diff --git a/woocommerce/class-sv-wc-plugin.php b/woocommerce/class-sv-wc-plugin.php index b85bb05ea..8e2cea0c9 100644 --- a/woocommerce/class-sv-wc-plugin.php +++ b/woocommerce/class-sv-wc-plugin.php @@ -460,15 +460,21 @@ private function includes() { */ protected function setupClassAliases() : void { - class_alias( - Country_Helper::class, - '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_14_0\\Country_Helper' - ); - - class_alias( - PaymentFormContextChecker::class, - '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_14_0\\PaymentFormContextChecker' - ); + $countryHelperAlias = '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_14_0\\Country_Helper'; + if (! class_exists($countryHelperAlias)) { + class_alias( + Country_Helper::class, + $countryHelperAlias + ); + } + + $paymentFormContextCheckerAlias = '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_14_0\\PaymentFormContextChecker'; + if (! class_exists($paymentFormContextCheckerAlias)) { + class_alias( + PaymentFormContextChecker::class, + $paymentFormContextCheckerAlias + ); + } }