By default, Woocommerce ajax add to cart functionality is only supposed to apply to simple products on archive, shop, category pages, etc.. But for some reason it is also adding variable products to the cart when I click "Select Options." Select Options is supposed to go to the product page. How can I disable ajax add to cart on variable products?
1 Answer
Here's the fix...
Change the line in \inc\woocommerce\template-tags-categories.php which reads:
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button ajax_add_to_cart' : '',
to:
$product->is_purchasable() && $product->is_in_stock() && $product->is_type( 'simple' ) ? 'add_to_cart_button ajax_add_to_cart' : '',