Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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