| 1 |
<?php |
| 2 |
|
| 3 |
use Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface; |
| 4 |
|
| 5 |
/** |
| 6 |
* Class for integrating with WooCommerce Blocks |
| 7 |
*/ |
| 8 |
class Sdevs_Subscrpt_WC_Integration implements IntegrationInterface { |
| 9 |
|
| 10 |
/** |
| 11 |
* The name of the integration. |
| 12 |
* |
| 13 |
* @return string |
| 14 |
*/ |
| 15 |
public function get_name() { |
| 16 |
return 'sdevs-subscrpt-wc'; |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* When called invokes any initialization/setup for the integration. |
| 21 |
*/ |
| 22 |
public function initialize() { |
| 23 |
$this->register_main_integration(); |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Registers the main JS file required to add filters and Slot/Fills. |
| 28 |
*/ |
| 29 |
public function register_main_integration() { |
| 30 |
wp_enqueue_script( 'sdevs_subscrpt_cart_block' ); |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* Returns an array of script handles to enqueue in the frontend context. |
| 35 |
* |
| 36 |
* @return string[] |
| 37 |
*/ |
| 38 |
public function get_script_handles() { |
| 39 |
return array( 'sdevs_subscrpt_cart_block' ); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Returns an array of script handles to enqueue in the editor context. |
| 44 |
* |
| 45 |
* @return string[] |
| 46 |
*/ |
| 47 |
public function get_editor_script_handles() { |
| 48 |
return array( 'sdevs_subscrpt_cart_block' ); |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* An array of key, value pairs of data made available to the block on the client side. |
| 53 |
* |
| 54 |
* @return array |
| 55 |
*/ |
| 56 |
public function get_script_data() { |
| 57 |
return array(); |
| 58 |
} |
| 59 |
} |
| 60 |
|