Automattic\WooCommerce\Blocks\BlockTypes

ProductCollection::set_product_collection_namespace()privateWC 1.0

Set PC block namespace for Interactivity API.

Method of the class: ProductCollection{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->set_product_collection_namespace( $p );
$p(WP_HTML_Tag_processor) (required)
Initial tag processor.

ProductCollection::set_product_collection_namespace() code WC 9.4.2

private function set_product_collection_namespace( $p ) {
	$p->set_attribute( 'data-wc-interactive', wp_json_encode( array( 'namespace' => 'woocommerce/product-collection' ), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP ) );
}