D
D
DenKG2017-01-22 19:42:24
WordPress
DenKG, 2017-01-22 19:42:24

Problem with sorting products in WordPress. How to fix?

I have some strange problem with sorting the displayed products.
In total I have 17 products in the catalog. These are: House 1, House 2, House 3, etc. As a result, the house numbers should go in order from 1 to 17. But now for some reason it looks like this for me: House 1, House 10, House 11, House 12, House 13, House 14, House 15, House 16, House 17 , House 2, 3, 4, 5, 6, 7, 8, 9.
In the Woocommerce settings, the sorting of products is by default (random order + name).
Please tell me how to solve this problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP_Panda, 2017-01-23
@wp_panda

or specify the output priority in the metafield
or get an array of products into an array, and write a function for sorting it by title, in which you get only numbers from it and cast them to
int
02, Building 03, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question