Automattic\WooCommerce\Blocks\SharedStores
ProductsStore::register_state
Register the interactivity state if products have been loaded.
Method of the class: ProductsStore{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = ProductsStore::register_state(): void;
ProductsStore::register_state() ProductsStore::register state code WC 10.7.0
private static function register_state(): void {
$state = array();
if ( ! empty( self::$products ) ) {
$state['products'] = self::$products;
}
if ( ! empty( self::$product_variations ) ) {
$state['productVariations'] = self::$product_variations;
}
if ( ! empty( $state ) ) {
wp_interactivity_state( self::$store_namespace, $state );
}
}