• Resolved Josh Robbs

    (@jwrobbs)


    I’m annoyed that my Google Fu has failed me. I think it’s because I’m using order twice.

    In the backend, “Orders” is in the WooCommerce submenu. If you click on an order from that list, you’re shown a list of the items ordered.

    How do I reorder “items ordered” section of that page? I can do the logic. I can’t find the hook or template I need to work with.

    Thanks for the help!

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

    (@rainfallnixfig)

    Hi @jwrobbs,

    How do I reorder “items ordered” section of that page?

    There is a little “arrow” in the Edit Order page that will let you sort items in asc/desc order, here’s a screenshot:


    Link to image: https://snipboard.io/IxJLSm.jpg

    Other than this default functionality, you’d need to add a bit of additional custom code to achieve other sorting or drag and dropping. To modify the returned set of order items from a given order you’d want to look at the woocommerce_order_get_items filter hook. You will find the WooCommerce hooks reference here: https://woocommerce.github.io/code-reference/hooks/hooks.html.

    The order items data structure is complex (it’s an array of associative arrays) and if you do require more help with the actual coding, we’d recommend consulting a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    Cheers.

    Thread Starter Josh Robbs

    (@jwrobbs)

    “The order items data structure is complex” Too true! I figured it out when I rebuilt the cart and checkout pages. But that looks like the hook I was looking form

    Thanks!

    Mirko P.

    (@rainfallnixfig)

    You’re welcome! Good luck with getting this sorted out!

    If you get stuck I’d also suggest asking in the #developers channel of the WooCommerce Community Slack where many Woo experts hang out.

    Cheers.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change the item order of a WooCommerce order in the admin’ is closed to new replies.