Skip to content

Instantly share code, notes, and snippets.

@DxDiagDx
Last active Aug 4, 2020
Embed
What would you like to do?
Woo: условие вывода для товаров отдельной категории
add_action( 'woocommerce_after_single_product_summary', 'bbloomer_single_category_slug' );
function bbloomer_single_category_slug() {
if ( has_term( 'chairs', 'product_cat' ) ) {
echo 'Something';
}
elseif ( has_term( 'tables', 'product_cat' ) ) {
echo 'Something else';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment