order by SKU code – kind of working but not really – woocommerce
-
Hi there,
Thanks in advance for your help!
I am trying to order products by sku ascending on a shop page and custom tax page in woocommerce: http://www.playimports.com.au/la-grande-famille/
I am using the following code:
add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby'); function am_woocommerce_catalog_orderby( $args ) { $args['meta_key'] = '_sku'; $args['orderby'] = 'meta_value'; $args['order'] = 'asc'; return $args; }
It kind of works but some of the products are out of order.
Does anyone have any ideas what I could try to make it order perfectly?
Thanks so much!
Sarah
- The topic ‘order by SKU code – kind of working but not really – woocommerce’ is closed to new replies.