]*?>/mi';
$regex_for_order_summary = '/
]*?>/mi';
$has_i2_template = ! preg_match( $regex_for_order_summary_subtotal, $content );
if ( $has_i2_template ) {
$content = preg_replace( $regex_for_order_summary, $order_summary_with_inner_blocks, $content );
}
return $content;
}
/**
* Extra data passed through from server to client for block.
*
* @param array $attributes Any attributes that currently are available from the block.
* Note, this will be empty in the editor context when the block is
* not in the post content on editor load.
*/
protected function enqueue_data( array $attributes = [] ) {
parent::enqueue_data( $attributes );
$this->asset_data_registry->add( 'countryData', CartCheckoutUtils::get_country_data() );
$this->asset_data_registry->add( 'baseLocation', wc_get_base_location() );
$this->asset_data_registry->add( 'isShippingCalculatorEnabled', filter_var( get_option( 'woocommerce_enable_shipping_calc' ), FILTER_VALIDATE_BOOLEAN ) );
$this->asset_data_registry->add( 'displayItemizedTaxes', 'itemized' === get_option( 'woocommerce_tax_total_display' ) );
$this->asset_data_registry->add( 'displayCartPricesIncludingTax', 'incl' === get_option( 'woocommerce_tax_display_cart' ) );
$this->asset_data_registry->add( 'taxesEnabled', wc_tax_enabled() );
$this->asset_data_registry->add( 'couponsEnabled', wc_coupons_enabled() );
$this->asset_data_registry->add( 'shippingEnabled', wc_shipping_enabled() );
$this->asset_data_registry->add( 'hasDarkEditorStyleSupport', current_theme_supports( 'dark-editor-style' ) );
$this->asset_data_registry->register_page_id( isset( $attributes['checkoutPageId'] ) ? $attributes['checkoutPageId'] : 0 );
$this->asset_data_registry->add( 'isBlockTheme', wc_current_theme_is_fse_theme() );
$this->asset_data_registry->add( 'activeShippingZones', CartCheckoutUtils::get_shipping_zones() );
$pickup_location_settings = LocalPickupUtils::get_local_pickup_settings();
$this->asset_data_registry->add( 'localPickupEnabled', $pickup_location_settings['enabled'] );
// Hydrate the following data depending on admin or frontend context.
if ( ! is_admin() && ! WC()->is_rest_api_request() ) {
$this->asset_data_registry->hydrate_api_request( '/wc/store/v1/cart' );
}
/**
* Fires after cart block data is registered.
*
* @since 2.6.0
*/
do_action( 'woocommerce_blocks_cart_enqueue_data' );
}
/**
* Register script and style assets for the block type before it is registered.
*
* This registers the scripts; it does not enqueue them.
*/
protected function register_block_type_assets() {
parent::register_block_type_assets();
$chunks = $this->get_chunks_paths( $this->chunks_folder );
$vendor_chunks = $this->get_chunks_paths( 'vendors--cart-blocks' );
$shared_chunks = [];
$this->register_chunk_translations( array_merge( $chunks, $vendor_chunks, $shared_chunks ) );
}
/**
* Get list of Cart block & its inner-block types.
*
* @return array;
*/
public static function get_cart_block_types() {
return [
'Cart',
'CartOrderSummaryTaxesBlock',
'CartOrderSummarySubtotalBlock',
'CartOrderSummaryTotalsBlock',
'FilledCartBlock',
'EmptyCartBlock',
'CartTotalsBlock',
'CartItemsBlock',
'CartLineItemsBlock',
'CartOrderSummaryBlock',
'CartExpressPaymentBlock',
'ProceedToCheckoutBlock',
'CartAcceptedPaymentMethodsBlock',
'CartOrderSummaryCouponFormBlock',
'CartOrderSummaryDiscountBlock',
'CartOrderSummaryFeeBlock',
'CartOrderSummaryHeadingBlock',
'CartOrderSummaryShippingBlock',
'CartCrossSellsBlock',
'CartCrossSellsProductsBlock',
];
}
}
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\BlockTypes\Cart" not found in /home/valigeria/public_html/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php:295
Stack trace:
#0 /home/valigeria/public_html/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php(101): Automattic\WooCommerce\Blocks\BlockTypesController->get_block_types()
#1 /home/valigeria/public_html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks('')
#2 /home/valigeria/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 /home/valigeria/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /home/valigeria/public_html/wp-settings.php(695): do_action('init')
#5 /home/valigeria/public_html/wp-config.php(111): require_once('/home/valigeria...')
#6 /home/valigeria/public_html/wp-load.php(50): require_once('/home/valigeria...')
#7 /home/valigeria/public_html/wp-blog-header.php(13): require_once('/home/valigeria...')
#8 /home/valigeria/public_html/index.php(17): require('/home/valigeria...')
#9 {main}
thrown in /home/valigeria/public_html/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php on line 295