Attribute values – how to make them appear in the same order for each product?
-
Hi All,
So I am almost done with setting up the Woocommerce shop, however have one issue. I have been adding products one by one and didn’t care that much about the order of product attributes.
As a result, attributes of many products are shown not in a correct order. Now, I would like to bulk edit them so that each product page shows the same attribute as first, second etc.
Please see below screenprint. I have market the attributes I want to appear in the specific order with numbers at the beginning. I want this to happen for every product and obviously I wouldn’t like to do this one by one.
Please see list of attibutes here
Is there any solution for this?
I have tried using this code but seems not to be working.
/** * Sort Attribute values in ascending order for any attribute * @param array $args * @return array return sorted $args array */ function abd_sort_wc_attribute_values( $args ){ $get_options = $args['options']; asort( $get_options ); $args['options'] = $get_options; return $args; } add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'abd_sort_wc_attribute_values', 10, 1 );
The page I need help with: [log in to see the link]
- The topic ‘Attribute values – how to make them appear in the same order for each product?’ is closed to new replies.