I am using wordpress REST API to query the database.
For each product (a custom post) I have a meta which is product_price
at a certain currency currency_rate
.
I need to run a query to get all products ordered ASC or DESC depending on product_price
. However, since each price is at a different currency, the query needs first to convert all prices to a common currency, then sort them by the chosen order. I am not able to do it.
I found this link
wordpress orderby filter but I couldn’t understand how to use it. The documentation is not clear at all for me. I need to modify the ordering by something similar to the below
What I need to do is to multiply each price by a conversion rate and feed that into the query to give me the posts in the correct order. I am currently stuck. Thanks for your help.
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com