Ecommerce Shopify WordPress Discussion

remove_action on woocommerce_template_single_add_to_cart has no effect

I am using WooCommerce 8.5.2 with Wordpress 6.4.2. There are no other plugins installed/activated. I want to remove the 'add to cart' button in the product page and insert a custom button. My code adds the custom button, but the 'add to cart' button remains. add_action('woocommerce_single_product_summary', 'replace_product_add_to_cart_button', 1); //add_action('woocommerce_single_product_summary', 'replace_product_add_to_cart_button'); //Does not work. Works upto priority 9. function replace_product_add_to_cart_button(){ global $product; if( $product->is_type( 'variable' ) ) { remove_action('woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20); add_action('woocommerce_single_variation', 'replace_add_to_cart_button', 20); } else { remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 30); remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30); //This does not work add_action('woocommerce_single_product_summary', 'replace_add_to_cart_button'); // This works fine } } I have tested with several themes and none works. Any idea of what am I doing wrong?
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.