I need some help from wordpress developers.
1. I want to list posts (build in posts) sorted by percentage discount value between two meta key values.
meta_key = price
meta_key = lowprice
discount = (price - lowprice) / price * 100)
I want to order posts by this result and display posts by discount range, 0-25%,25-50%, +50%.
2. I want to list all unique custom fields from a certain meta key from current category. I mean I have a custom meta key "product_brand" and I want to list all unique brands from the current category on the category page.
I need proved examples with your working wordpress sites that used these snippets.