woocommerce_template_single_add_to_cart()
Trigger the single product add to cart action.
Hooks from the function
Return
null
. Nothing (null).
Usage
woocommerce_template_single_add_to_cart();
woocommerce_template_single_add_to_cart() woocommerce template single add to cart code WC 9.7.1
function woocommerce_template_single_add_to_cart() { global $product; if ( $product instanceof WC_Product ) { /** * Single product add to cart action. * * @since 1.0.0 */ do_action( 'woocommerce_' . $product->get_type() . '_add_to_cart' ); } }