Add product attribute to Woocommerce’s blocks in Gutenberg

As the blocks more more and more to front-end rendering… there’s only one filter that I’ve been able to find for modifying the output of the blocks via PHP. woocommerce_blocks_product_grid_item_html and I’m not even sure if that will work on the All Products block which may/may not use the same code as the other products list blocks.

Here’s an example that 1. removes the link and 2. adds the product’s short description:

/**
 * Add short descriptions
 *
 * @param string $html
 * @param object $data
 * @param WC_Product $product
 * @return string
 */
function kia_blocks_product_grid_item_html( $html, $data, $product ) {
    $short_description = $product->get_short_description() ? '<div class="wp-block-grid__short-description">' . wc_format_content( $product->get_short_description() ) . ' </div>' : '';

    return 
        "<li class=\"wc-block-grid__product\">
            {$data->image}
            {$data->title}
            {$data->badge}
            {$data->price}
            {$data->rating}" .

            $short_description

            . "{$data->button}
        </li>";
}
add_filter( 'woocommerce_blocks_product_grid_item_html', 'kia_blocks_product_grid_item_html', 10, 3 );