• Resolved piotrk87

    (@piotrk87)


    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]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thanks.

    Thread Starter piotrk87

    (@piotrk87)

    Thanks @rainfallnixfig ,

    Actually I had to buy a separate plugin in order to do this. It’s a pity it works this way, I think it’s a big disadvantage of WooCommerce.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    Glad to hear you managed to sort this using a plugin.

    For customizations that are not part of core WooCommerce, you could either use third-party extensions/plugins already available and ready to use or add custom code to your site.

    This forum supports only the basic functions that are included with core WooCommerce, so if you don’t want to purchase plugins you may look for free ones (if available) or get started with WooCommerce development using our WooCommerce Developer Resources.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attribute values – how to make them appear in the same order for each product?’ is closed to new replies.