• How do I modify the product loop on the homepage so that I can add a custom button after the product titles?

    https://prntscr.com/rtrglw

    The products are being generated by the ‘Newest Products’ block

    The usual woocommerce_shop_loop_item_title hook does not seem to work on the homepage, only on the shop page. I would like to add something like this: https://prntscr.com/rtrgyk

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • What code are you using that is working on the shop page? You may need to try adding something like is_home() or is_front_page() as well

    Thread Starter eyarplox

    (@eyarplox)

    Hi, I found the function but it’s protected, it’s in woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractProductGrid.php

    it’s this one: protected function get_price_html( $product )

    any way I can customize that?

    • This reply was modified 4 years, 7 months ago by eyarplox.

    I don’t think there is a filter for it on the homepage because it is using a block and blocks don’t have filters like what normal WP is used to. You’d have to rewrite the block to insert your own content.

    Maybe somebody else will come along that has done it before though and has some code for it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modify Homepage’ is closed to new replies.