| @@ -81,8 +81,9 @@ | ||
| 81 | 81 | REST_Controller $rest_settings_controller, |
| 82 | 82 | REST_Controller $rest_onboarding_controller, |
| 83 | 83 | REST_Controller $rest_payment_controller, |
| 84 | 84 | REST_Controller $rest_log_controller, |
| 85 | + REST_Controller $rest_store_integration_controller, | |
| 85 | 86 | Interface_Product_Controller $product_controller, |
| 86 | 87 | Interface_Async_Process_Controller $async_process_controller, |
| 87 | 88 | Interface_Order_Controller $order_controller |
| 88 | 89 | ) { |
| @@ -92,9 +93,9 @@ | ||
| 92 | 93 | $this->file_path = $constants->get_plugin_file_path(); |
| 93 | 94 | $this->base_name = $constants->get_plugin_basename(); |
| 94 | 95 | $this->migration_manager = $migration_manager; |
| 95 | 96 | |
| 96 | - \add_action( 'plugins_loaded', array( $this, 'install' ) ); | |
| 97 | + \add_action( 'init', array( $this, 'install' ) ); | |
| 97 | 98 | |
| 98 | 99 | // I18n. |
| 99 | 100 | \add_action( 'plugins_loaded', array( $i18n_controller, 'load_text_domain' ) ); |
| 100 | 101 | |
| @@ -113,8 +114,9 @@ | ||
| 113 | 114 | \add_action( 'rest_api_init', array( $rest_settings_controller, 'register_routes' ) ); |
| 114 | 115 | \add_action( 'rest_api_init', array( $rest_onboarding_controller, 'register_routes' ) ); |
| 115 | 116 | \add_action( 'rest_api_init', array( $rest_payment_controller, 'register_routes' ) ); |
| 116 | 117 | \add_action( 'rest_api_init', array( $rest_log_controller, 'register_routes' ) ); |
| 118 | + \add_action( 'rest_api_init', array( $rest_store_integration_controller, 'register_routes' ) ); | |
| 117 | 119 | |
| 118 | 120 | // Payment hooks. |
| 119 | 121 | \add_filter( 'woocommerce_payment_gateways', array( $payment_controller, 'register_gateway_classes' ) ); |
| 120 | 122 | \add_action( 'woocommerce_blocks_loaded', array( $payment_controller, 'register_gateway_gutenberg_block' ) ); |
| @@ -144,8 +146,11 @@ | ||
| 144 | 146 | \add_action( $constants->get_hook_add_order_indexes(), array( $order_controller, 'migrate_orders_to_use_indexes' ) ); |
| 145 | 147 | |
| 146 | 148 | // WooCommerce Compat. |
| 147 | 149 | \add_action( 'before_woocommerce_init', array( $this, 'declare_woocommerce_compatibility' ) ); |
| 150 | + | |
| 151 | + // Cart identifier generation. | |
| 152 | + \add_action( 'woocommerce_init', array( $order_controller, 'ensure_cart_info_exists' ) ); | |
| 148 | 153 | } |
| 149 | 154 | |
| 150 | 155 | /** |
| 151 | 156 | * Handle activation of the plugin. |