It’s time to find the function for ajax add to cart button. I start at the home page, one of these loops for feature products and follow the shortcodes to see where it takes me.
Recent products shortcode -> WC_Shortcodes::recent_products -> WC_Shortcode_Products::get_content -> product_loop() -> wc_get_template_part( 'content', 'product' );
By the way, I remembered that somewhere I read that there is no ajax add to cart inside loops and only on the single product page. No problem keep digging…
...-> do_action( 'woocommerce_after_shop_loop_item' );
OK, I need to pay the server’s bill now, takes a few minutes.
5 Minutes later, I’m back. Where was I?
..-> woocommerce_template_loop_add_to_cart -> wc_get_template( 'loop/add-to-cart.php', $args );
wc_get_template( 'loop/add-to-cart.php', $args );
But a problem, since I set a height for the wrapper and overflow: hidden it doesn’t show up on all the items. Easy to fix I hope :);