How can I filter the output of the woocommerce 'product categories' shortcode. I need to add a button into each product in the loop.
Docs WooCommerce: Product Categories shortcode
WooCommerce code source (github): class-wc-shortcodes.php
It should work. The syntax is strange for me and I'm not sure about how I am supposed to change {$product_categories} syntax code in it:
function add_html_to_shortcode_product_categories() {
echo '<a class = "cta_btn" href="#">shop now</a>';
}
add_action('woocommerce_shortcode_after_{$product_categories}_loop', 'add_html_to_shortcode_product_categories', 20);
Some help would be greatly appreciated.