Skip to content

Instantly share code, notes, and snippets.

@yeriepiscesa
Created April 20, 2019 04:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
<?php
add_filter('woocommerce_is_purchasable', 'woocommerce_restaurant_purchasable', 10, 2 );
function woocommerce_restaurant_purchasable($is_purchasable, $product) {
return (!$product->managing_stock() ? false : $is_purchasable);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment