• Resolved Krzysztof Planeta

    (@chrisplaneta)


    Hi

    Products displayed in the “All products” block have no IDs anywhere in their HTML, thus they cannot be tracked with any analytics tools as “item views”. Is there any way to add this ID to the HTML of these poroducts?

    I tried using the “woocommerce_blocks_product_grid_item_html” filter, but it doesn’t work with this block. The community on github did not give me any answers so I deleted my post after a week of waiting for a reply.

    On a sidenote, where can I find the PHP file responsible for showing this block in your github repo? There are hundreds of files with no clear description of what they do.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @chrisplaneta

    Unfortunately, the “All Products” block is rendered using JavaScript, not PHP, which is why the woocommerce_blocks_product_grid_item_html filter doesn’t work.

    In terms of the PHP file responsible for showing the block, the “All Products” block is part of the WooCommerce Blocks plugin, which is primarily built with JavaScript and React. You won’t find a specific PHP file for it.

    However, if you’re comfortable with JavaScript, you can find the files related to the “All Products” block in the WooCommerce Blocks GitHub repository here: https://github.com/woocommerce/woocommerce-blocks/tree/trunk/assets/js/blocks/products/all-products

    I hope this information is helpful. Please let us know if you have any other questions.

    Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Howdy,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – feel free to?create a new topic?if you need any further help.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add content to “All products” block?’ is closed to new replies.