1

I have a query that pulls products from Woocommerce on a special page depending on selections from the user. It works but they're out of order.

You can drag products around in the admin (Products) and it changes the display order on the normal front end store. Where is this order stored in the database so I can order my query results to match this order?

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
dstana
  • 350
  • 2
  • 10

1 Answers1

3

It is about the orderby argument used in the main default query which is menu_order column and post_title column as second sorting argument both located in wp_posts database table, for "product" post_type column.


Some related threads to alter the product order in frontend:

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
  • This is what I thought it would be. But the menu_order values of the products are either 0 or 1. Surely there's something else to distinguish order between two dozen products? – dstana Feb 08 '19 at 01:38
  • @dstana I have updated my answer… First sorting argument is "menu_order" and second sorting "argument is "post_title"… – LoicTheAztec Feb 08 '19 at 02:23