WooCommerce Arrange Order of Product Images

WooCommerce Tips

The code below is no longer necessary as long as your using the latest version of WooCommerce. I installed 1.5.2 and noticed that the order of images can now be controlled via a template file. Thus, the code below is no longer needed because, by default, WooCommerce adheres to the image order set in the admin. Cheers!

I recently started working with WooCommerce for a client project. WooCommerce is an eCommerce solution for WordPress that was forked from Jigoshop. There are now many eCommerce solutions to choose from with WordPress.

My personal favorites are Shopp and WooCommerce coming in a close second. It really depends on the type of project I’m working on as it should for you as well.

Make WooCommerce adhere to image order:
While working with adding images to a product in WooCommerce I noticed that it disregarded image order when displaying the product on the front-end.

To fix the issue I copied the function from ‘Woocommerce_template_functions.php’ into my functions.php and added “order and orderby” to the array.

The complete code is below for you to grab. This is a simple fix but often I’m the one looking for those simple fixes so I’m sure others are out there.

If there’s a more elegant way to fix this please share. Thanks!