| 1 |
<?php |
| 2 |
|
| 3 |
namespace SpringDevs\Subscription\Illuminate; |
| 4 |
|
| 5 |
/** |
| 6 |
* Globally Load Scripts. |
| 7 |
*/ |
| 8 |
class Block { |
| 9 |
|
| 10 |
/** |
| 11 |
* Initialize the Class. |
| 12 |
*/ |
| 13 |
public function __construct() { |
| 14 |
add_action( 'woocommerce_blocks_loaded', array( $this, 'block_registration' ) ); |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* Block Registration. |
| 19 |
* |
| 20 |
* @return void |
| 21 |
*/ |
| 22 |
public function block_registration() { |
| 23 |
require_once __DIR__ . '/wc-block-integration.php'; |
| 24 |
add_action( 'woocommerce_blocks_cart_block_registration', array( $this, 'register' ) ); |
| 25 |
add_action( 'woocommerce_blocks_checkout_block_registration', array( $this, 'register' ) ); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Register the class. |
| 30 |
* |
| 31 |
* @param \Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry $integration_registry registry. |
| 32 |
* |
| 33 |
* @return void |
| 34 |
*/ |
| 35 |
public function register( $integration_registry ) { |
| 36 |
$integration_registry->register( new \Sdevs_Subscrpt_WC_Integration() ); |
| 37 |
} |
| 38 |
} |
| 39 |
|