2 added 534 characters in body
source | link

You can check woocommerce related conditional tag here -

https://docs.woocommerce.com/document/conditional-tags/

You can try below code. In this code add_action execute only when product have category like men or women.

function wp_extracode_for_products()
{
  echo'your code'; 
}

add_action( 'wp', 'remove_product_content' );

function remove_product_content() {

  if ( is_product() && (has_term( 'men', 'product_cat' )|| has_term( 'women', 'product_cat' ) )) {

   add_action('woocommerce_single_product_summary', 'wp_extracode_for_products', 60);

  }
}

You can check woocommerce related conditional tag here -

https://docs.woocommerce.com/document/conditional-tags/

You can check woocommerce related conditional tag here -

https://docs.woocommerce.com/document/conditional-tags/

You can try below code. In this code add_action execute only when product have category like men or women.

function wp_extracode_for_products()
{
  echo'your code'; 
}

add_action( 'wp', 'remove_product_content' );

function remove_product_content() {

  if ( is_product() && (has_term( 'men', 'product_cat' )|| has_term( 'women', 'product_cat' ) )) {

   add_action('woocommerce_single_product_summary', 'wp_extracode_for_products', 60);

  }
}
1
source | link

You can check woocommerce related conditional tag here -

https://docs.woocommerce.com/document/conditional-tags/