If you’re running WooCommerce and you sell digital products, here’s how you can change their order.
By default, WooCommerce will order them from Oldest > Newest. So the first products you ordered go first, and the latest products you ordered go at the bottom. If it’s a subscription site, where customers continually get new digital downloads, it might be nice to have the latest downloads on top.
The first thing you will need to do is make a copy of the WooCommerce template, into your theme. You’re probably using a Child Theme, right?
-
- Copy
woocommerce/templates/order/order-downloads.php
into
yourtheme/woocommerce/order/order-downloads.php
If your theme already has this file there, you can just make your edits there.
- Change this line
<?php foreach ( $downloads as $download ) : ?>
to this
<?php foreach ( array_reverse($downloads) as $download ) : ?>
- That’s it! PHP’s array_reverse does all the magic for you. Now all your Available Downloads will be ordered with the newest on the top.
- Copy