WooCommerce remove_action and add_action [closed]

You can create your own dedicated function and overwrite a default one when a function is in a function_exists statement.

if ( ! function_exists( 'woocommerce_template_single_add_to_cart' ) ) {}

You can use the woocommerce_template_single_add_to_cart function from wc-template-functions.php

Just copy/paste this function to your woocommerce-functions.php and modify it with the statement you want.

This method is simple if you don’t want to add multiple template based on specific conditions.

tech