Skip Navigation

[Resolved] display search results from woo products in price sorting from higest price

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 17 replies, has 2 voices.

Last updated by giorgosK 6 years ago.

Assisted by: Minesh.

Author
Posts
#1192511

I am trying to: sort the search results output per price

Link to a page where the issue can be seen: elastikagiannoulis.gr

I expected to see: the search results in the table sorted per price

Instead, I got: mixed price sorting

#1192517

i set the results to be in Products ordered by Field - views_woo_price, descending
hidden link
hidden link
shouldnt the results be in price descending order ?

#1192549

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - what if you try to change the third dropdown in the ordering section as displayed with the following screenshot:
=> hidden link

Instead of "As a native custom field" chose " As a Number" option and try to resolve your issue.

#1192561

tried this also

the problem still excists

hidden link

#1192562

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

can I have problem URL and access details?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1192611

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - thank you for sharing access details but when I check the product with each product the views_woo_price is set as this text "Καλέστε για Τιμές".

Please check the following screenshot:
=> hidden link

Have you run the Woocommerce settings once?
=> https://toolset.com/documentation/user-guides/woocommerce-views-calculated-fields-and-batch-update/#using-calculated-woocommerce-fields-e-g-views_woo_price-in-custom-search

Can you please confirm that the views_woo_price field has a numeric value first as I checked the query and query is correctly generated:

SELECT   elA_posts.* FROM elA_posts  INNER JOIN elA_postmeta ON ( elA_posts.ID = elA_postmeta.post_id ) WHERE 1=1  AND elA_posts.ID NOT IN (1151) AND ( ( elA_posts.post_title LIKE '{3e95cf4ba33675a3ad517efe7b5b5ead6dcca378803e94ce8fbda31dc7271069}WESTLAKE{3e95cf4ba33675a3ad517efe7b5b5ead6dcca378803e94ce8fbda31dc7271069}' ) )  AND ( 
  elA_postmeta.meta_key = 'views_woo_price'
) AND elA_posts.post_type = 'product' AND ((elA_posts.post_status = 'publish' OR elA_posts.post_status = 'private')) GROUP BY elA_posts.ID ORDER BY elA_postmeta.meta_value+0 DESC 
#1192653

the message "Καλέστε για Τιμές" means call for price.

I use a plugin yith catalog mode that hides prices for unregistered users. Only loged in users should see prices.

#1192655

the numeric values presented in the table search results are shown when a user is logged in
hidden link

#1192910

i really need to speed up the solution, your moto is Custom WordPress Development For Non-Coders, but this is not so true. To achieve a good working result i reallize i must pay for development.

Is there a solution for premium support to have solutions from your support team faster?

I tried once to get an offer from a contractor but it was way to expensive, could you finalize this at a per hour price?

thank you

#1192929

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - Can I perform few checks as it looks like due to the text added to the views_woo_price field the ordering is not working.

I change the order to with regular price DESC and I can see the sorting works correctly. That means the "views_woo_price" field must hold the numeric value in order to display the correct results.

As you can see with the following link results are displayed in correct sort order:
=> hidden link

#1192961

that is so great, you are so experience and of good knowledge of toolset and woocommerce thank you!

this is working

but why is the option field _regular_price hidden link

not present in the live site? hidden link

thank you

#1192962

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What you need to do is - Go to:
=> Toolset => Settings => Front-end content => Hidden custom fields section => Click on button "Select custom fields" and find and checkmark the regular price field

Then go to your view, reload your view, if already open, and then regular price field will be available to display.

#1192992

i did on the live site as you wrote but after many refresh page i still dont get the correct descending results.

is there something more i must do in the live site?

can you test the live site see if it is working and maybe it is a caching issue?

#1192993

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share problem URL and access details of your live site so I can check. Also, add what view you are using on live site.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1192994

i added you as an admin also on the live site

hidden link

with the same credentials

WordPress access details:
hidden link
developer / 7CDnJ&*IcaVuzU4S#7iafQYN