WooCommerce 3.0 - Hide Product Title Change Information
Since we updated Woocommerce version 3, our order confirmations have been showing huge headers that include details of the change. I don't like the way it looks and it breaks up some important functionality in some custom plugins.
Reference: Order Name Displays changes since the upgrade to version 3 for WC.
There is a filter that can be used to disable the display of this data in the title from what I understand. But I don't know where to apply the filter. woocommerce_product_variation_title_include_attribute_name
Is there a quick way to apply a filter to change it before displaying like it used to be?
source to share
This filter should return a value false
for the first argument $should_include_attributes
in an anchor filter like so: woocommerce_product_variation_title_include_attributes
add_filter( 'woocommerce_product_variation_title_include_attributes', 'custom_product_variation_title', 10, 2 );
function custom_product_variation_title($should_include_attributes, $product){
$should_include_attributes = false;
return $should_include_attributes;
}
The code goes in the function.php file of your active child theme (or theme), as well as any plugin file.
It should work as you expect.
Update: Shorter way:
add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' );
The code goes in the function.php file of your active child theme (or theme), as well as any plugin file.
works too.
source to share