set( 'classic.checkout', static fn( Container $c ): ClassicCheckout => new ClassicCheckout( $c->get( 'extra.service' ), $c->get( 'context.factory' ), $c->get( 'registry.types' ), $c->get( 'goals.service' ), $c->get( 'settings' ) ) ); $c->set( 'classic.assets', static fn( Container $c ): ClassicAssets => new ClassicAssets( $c->get( 'extra.service' ), $c->get( 'goals.service' ) ) ); } /** * {@inheritDoc} * * @param Container $c Container. */ public function boot( Container $c ): void { $classic = static fn(): ClassicCheckout => $c->get( 'classic.checkout' ); add_action( 'wp_enqueue_scripts', static fn() => $c->get( 'classic.assets' )->enqueue() ); add_action( $classic()->extras_hook(), static fn() => $classic()->render_extras() ); add_action( 'woocommerce_review_order_before_payment', static function () use ( $classic ): void { if ( ! wp_doing_ajax() ) { $classic()->render_goal(); } } ); add_action( 'woocommerce_checkout_update_order_review', static fn( $post_data ) => $classic()->on_update_order_review( $post_data ) ); add_filter( 'woocommerce_update_order_review_fragments', static fn( $fragments ) => $classic()->fragments( $fragments ) ); add_action( 'woocommerce_checkout_process', static fn() => $classic()->on_checkout_process() ); add_action( 'woocommerce_after_checkout_validation', static fn( $data, $errors ) => $classic()->after_validation( $data, $errors ), 10, 2 ); } }