Answers for "how to get product category in woocommmerce"

6

woocommerce get product id

global $product;
$product->get_id();
Posted by: Guest on July-03-2020
0

is product category woocommerce

if( has_term( 4, 'product_cat' ) ) {
	// do something if current product in the loop is in product category with ID 4
}
Posted by: Guest on February-26-2021

Code answers related to "how to get product category in woocommmerce"

Browse Popular Code Answers by Language