| 1 |
<?php declare(strict_types=1); |
| 2 |
|
| 3 |
namespace MultiSafepay\WooCommerce\Settings; |
| 4 |
|
| 5 |
/** |
| 6 |
* Defines all the methods to declare compatibility with third party plugins |
| 7 |
* |
| 8 |
* Class ThirdPartyCompatibility |
| 9 |
* |
| 10 |
* @package MultiSafepay\WooCommerce\Settings |
| 11 |
*/ |
| 12 |
class ThirdPartyCompatibility { |
| 13 |
/** |
| 14 |
* Declare all the compatibilities with third party plugins |
| 15 |
* |
| 16 |
* @return void |
| 17 |
*/ |
| 18 |
public function declare_all_compatibilities(): void { |
| 19 |
$this->declare_hpos_compatibility(); |
| 20 |
$this->declare_blocks_compatibility(); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Declare compatibility with high performance order storage features |
| 25 |
* |
| 26 |
* @return void |
| 27 |
*/ |
| 28 |
public function declare_hpos_compatibility(): void { |
| 29 |
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { |
| 30 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( |
| 31 |
'custom_order_tables', |
| 32 |
MULTISAFEPAY_PLUGIN_DIR_PATH . 'multisafepay.php' |
| 33 |
); |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Declare compatibility with block-based checkout features |
| 39 |
* |
| 40 |
* @return void |
| 41 |
*/ |
| 42 |
public function declare_blocks_compatibility(): void { |
| 43 |
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { |
| 44 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( |
| 45 |
'cart_checkout_blocks', |
| 46 |
MULTISAFEPAY_PLUGIN_DIR_PATH . 'multisafepay.php' |
| 47 |
); |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
|