bel, 'display_cart_prices_including_tax' => false, ); }; return array( 'tax_label' => '', 'display_cart_prices_including_tax' => false, ); } /** * Prepare translations for inner blocks and dependencies. */ protected function get_inner_blocks_translations() { $wp_scripts = wp_scripts(); $translations = array(); $chunks = $this->get_chunks_paths( $this->chunks_folder ); $vendor_chunks = $this->get_chunks_paths( 'vendors--mini-cart-contents-block' ); $shared_chunks = [ 'cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend' ]; foreach ( array_merge( $chunks, $vendor_chunks, $shared_chunks ) as $chunk ) { $handle = 'wc-blocks-' . $chunk . '-chunk'; $this->asset_api->register_script( $handle, $this->asset_api->get_block_asset_build_path( $chunk ), [], true ); $translations[] = $wp_scripts->print_translations( $handle, false ); wp_deregister_script( $handle ); } $translations = array_filter( $translations ); return implode( '', $translations ); } /** * Register block pattern for Empty Cart Message to make it translatable. */ public function register_empty_cart_message_block_pattern() { register_block_pattern( 'woocommerce/mini-cart-empty-cart-message', array( 'title' => __( 'Empty Mini-Cart Message', 'woocommerce' ), 'inserter' => false, 'content' => '

' . __( 'Your cart is currently empty!', 'woocommerce' ) . '

', ) ); } /** * Returns whether the Mini-Cart should be rendered or not. * * @param array $attributes Block attributes. * * @return bool */ public function should_not_render_mini_cart( array $attributes ) { return isset( $attributes['cartAndCheckoutRenderStyle'] ) && 'hidden' !== $attributes['cartAndCheckoutRenderStyle']; } }