Created
July 5, 2019 11:46
-
-
Save yanknudtskov/588c46ac3a7f7c1f43cb4d8e0338e9b9 to your computer and use it in GitHub Desktop.
Forcibly disable ajax add to cart in WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Forcibly disable ajax add to cart | |
*/ | |
add_filter( 'woocommerce_product_supports', 'yanco_disable_ajax_add_to_cart_supports', 10, 3 ); | |
function yanco_disable_ajax_add_to_cart_supports( $supports_ajax, $feature, $product ) { | |
if ( 'ajax_add_to_cart' == $feature ) { | |
$supports_ajax = false; | |
} | |
return $supports_ajax; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment