wordpress - Prevent WooCommerce brand from being sellable -
wordpress - Prevent WooCommerce brand from being sellable -
hi there have online store running on woocommerce , using woocommerce brands plugin (http://docs.woothemes.com/document/wc-brands/) there 1 brand allowed show online cost not allowed sell.
is there function can add together particular brand functions.php alter add together cart button in category or widget layout "more info" , link product , on product page instead of add together cart section have text message saying phone call store.
you can filter woocommerce's is_purchasable method. item returns false not able purchased.
function so_26378581_purchasable( $purchasable, $product ){ if ( has_term( 'your-brand', 'product_brand', $product->id ) ){ $purchasable = false; } homecoming $purchasable; } add_action( 'woocommerce_is_purchasable', 'so_26378581_purchasable', 10, 2 ); this uses conditional logic test whether $product in question has your-brand term in product_brand taxonomy... via has_term() function.
by way, not type of functionality belongs in functions.php. theme should concerned display/appearances. recommend create own plugin, or add together to site specific snippets plugin.
wordpress woocommerce
Comments
Post a Comment