Skip to content

Instantly share code, notes, and snippets.

@yanknudtskov
Created July 5, 2019 11:46
Show Gist options
  • Save yanknudtskov/588c46ac3a7f7c1f43cb4d8e0338e9b9 to your computer and use it in GitHub Desktop.
Save yanknudtskov/588c46ac3a7f7c1f43cb4d8e0338e9b9 to your computer and use it in GitHub Desktop.
Forcibly disable ajax add to cart in WooCommerce
<?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