1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Display variant name without SKU in child product
  1. Home
  2. Knowledge Base
  3. Products Fields
  4. Display variant name without SKU in child product

Display variant name without SKU in child product

By default, when using variations as child products, product names include the SKU. If you’d like the name without the SKU, use this filter:

<?php
/**
* Display variant name without SKU in child product
*/
function prefix_variation_name_variable_child_select( $name, $variant ) {
return $variant->get_name();
}
add_filter( 'pewc_variation_name_variable_child_select', 'prefix_variation_name_variable_child_select', 10, 2 );

This is how to add a snippet.

Was this article helpful?

Need More Support?

If you can't find the answer that you're looking for, then please use the link below to raise a support ticket.
Contact Support

Related Articles