PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Price filter ordering as string

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello.

When we order by price the products are sorted as if the price is a string.

https://kruit-en-kramer.nl/producten/?filter=1&orderby=price&paged=1

Is there any way this can get fixed?

Hello

Paste your license key here - https://c2n.me/43SC6rb.png -> https://c2n.me/42HBIt7.png

Please  disable  my  plugin  and  do  a  test  - https://kruit-en-kramer.nl/producten/?orderby=price  - the result will be the same ( my plugin doesn't affect sorting )

Well it kind of does affect sorting

On version 2.2.5.1:
In the file index.php on line 2034 in the function get_catalog_orderby you define the $orderby variable. And you define the format on line 2037. The problem here is with notation. In the Netherlands decimals are defined with a comma and thousands with a dot. (I noticed you removed the format variable in version 2.2.5.3). And on line 2308 you call the get_catalog_orderby function to get the orderby parameters and put them in the $args variable which you use in line 2484, 2488 and 2492 as arguments for the WP_Query function.

A solution would be to be able to define the format again. It's okay if it can be done in the woof_order_catalog filter where we can catch if the orderby equals price and set the format to INTEGER ourselves.

Hello

Paste your license key here - https://c2n.me/43SC6rb.png -> https://c2n.me/42HBIt7.png

In the Netherlands decimals are defined with a comma and thousands with a dot.  - It does not matter. All prices in the database are stored in one format(float) And sorting works by values in the database

I'm not sure I understood you about the price format.  this is how it works in woocommerce - https://c2n.me/4bVy6fY.png - and there is no formatting

My code only works for ajax mode (shortcode [woof_products]) - And this is how woocommerce did before

Did  you  do a test  without  my  plugin?