You appear to be a bot. Output may be restricted
Description
Extra data passed through from server to client for block.
Usage
Cart::enqueue_data( $attributes );
Parameters
- $attributes
- ( array ) optional – 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.
Returns
void
Source
File name: woocommerce/packages/woocommerce-blocks/src/BlockTypes/Cart.php
Lines:
1 to 26 of 26
protected function enqueue_data( array $attributes = [] ) { $data_registry = Package::container()->get( AssetDataRegistry::class ); if ( ! $data_registry->exists( 'shippingCountries' ) ) { $data_registry->add( 'shippingCountries', $this->deep_sort_with_accents( WC()->countries->get_shipping_countries() ) ); } if ( ! $data_registry->exists( 'shippingStates' ) ) { $data_registry->add( 'shippingStates', $this->deep_sort_with_accents( WC()->countries->get_shipping_country_states() ) ); } $permalink = ! empty( $attributes['checkoutPageId'] ) ? get_permalink( $attributes['checkoutPageId'] ) : false; if ( $permalink && ! $data_registry->exists( 'page-' . $attributes['checkoutPageId'] ) ) { $data_registry->add( 'page-' . $attributes['checkoutPageId'], $permalink ); } // Hydrate the following data depending on admin or frontend context. if ( ! is_admin() && ! WC()->is_rest_api_request() ) { $this->hydrate_from_api( $data_registry ); } do_action( 'woocommerce_blocks_cart_enqueue_data' ); }