Reputation: 13
I noticed that woocommerce is threating different product attributes differently (see screenshot).
The attributes of the first product are added only with numbers after the dash. The attributes of the second product is listed below the product title.
I can't figure out why this happens.
How to make all product attributes look like the one of the first product?
Upvotes: 1
Views: 5037
Reputation: 253804
They can be many reasons. Before woocommerce 3 variation attributes where displayed as cart item meta data like "Seirin J + tube" … Now the variable products created under WooCommerce version 3+, display their attribute values in the title, like "Seirin B + tube"…
But hopefully there is some ways to unify this using some dedicated hooks.
1) Display attributes values in cart items title for all cases (this one is for you):
add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_true' );
2) Remove attributes values in cart items titles for all cases and display them as separated attribute
/ value
pairs under the title.
add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' );
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
Tested and works.
Upvotes: 9