Automattic\WooCommerce\EmailEditor\Integrations\WooCommerce\Renderer\Blocks
Product_Collection::render_product_grid
Render product grid using HTML table structure for email compatibility.
Метод класса: Product_Collection{}
Хуков нет.
Возвращает
Строку.
Использование
// private - только в коде основоного (родительского) класса $result = $this->render_product_grid( $products, $inner_block, $collection_type ): string;
- $products(массив) (обязательный)
- Array of WC_Product objects.
- $inner_block(массив) (обязательный)
- Inner block data.
- $collection_type(строка) (обязательный)
- Collection type identifier.
Код Product_Collection::render_product_grid() Product Collection::render product grid WC 10.4.3
private function render_product_grid( array $products, array $inner_block, string $collection_type ): string {
// We start with supporting 1 product per row.
$content = '';
foreach ( $products as $product ) {
$content .= $this->add_spacer(
$this->render_product_content( $product, $inner_block, $collection_type ),
$inner_block['email_attrs'] ?? array()
);
}
return $content;
}