Skip to content

Instantly share code, notes, and snippets.

@yeriepiscesa
Created April 20, 2019 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yeriepiscesa/f2da6015fb90d2582e7659134e509071 to your computer and use it in GitHub Desktop.
Save yeriepiscesa/f2da6015fb90d2582e7659134e509071 to your computer and use it in GitHub Desktop.
<?php
if (!function_exists('woocommerce_template_loop_add_to_cart')) {
function woocommerce_template_loop_add_to_cart() {
global $product;
if ( ! $product->is_in_stock() || ! $product->is_purchasable() ) return;
woocommerce_get_template('loop/add-to-cart.php');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment