Skip to content

Instantly share code, notes, and snippets.

View oo-matty's full-sized avatar

oomatty oo-matty

View GitHub Profile
@rynaldos-zz
rynaldos-zz / wc-aatc.php
Created December 12, 2017 18:44
[WooCommerce 3.0+] Ajax add to cart on variable products archive page
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
if ( ! function_exists( 'woocommerce_template_loop_add_to_cart' ) ) {
function woocommerce_template_loop_add_to_cart() {
global $product;
if ($product->get_type() == "variable" ) {
woocommerce_variable_add_to_cart();
}