Sorting Woocommerce Attributes alphabetical in Admin

When there are a lot of variations and you want to edit your stock per variation, the list of variants is not logical (in the admin). When you want to edit 1 variation you have to search the whole list (250+) to find it.

I found a solution here;
Change alphabetical sorting of attributes / variations on product page in Woocommerce shop

Read More

But when I edit a bulk edit a price and save the product, only the first 41 are updated. It is because of this line;

'orderby'     => 'menu_order',

This is my code;

$args = array(
'post_type'=>'product_variation',
'post_status' => array( 'private', 'publish' ),
'posts_per_page' => -1,
'meta_key' => 'attribute_pa_kleur', //rename with your attributes
'post_parent' => $post->ID,
'meta_query' => array(
    array(
        'key' => 'attribute_pa_kleur' //rename with your attributes
    ),

)

);

How can I fix this?

Related posts

Leave a Reply