I am working on a reverse auctioning system in PHP. My customers get bids from different vendors against their requested products/services. While displaying received bids to the logged in customer, I need to do a sorting based on weighted average against following criteria:
- Price (40%) -> Lowest price is good.
- Vendor Rating (20%) -> Rating = 1-5 (5 being best).
- Delivery Options (10%) -> More delivery options offered the best.
- Distance (10%) -> Lowest distance from customer location is the best.
- Payment Methods (10%) -> More payment methods offered the best.
So far I have been able to create following formula:
$weightage = ($price*.40) + ($rating*.20) + ($delivery_options*.10) + ($distance*.10) + ($payment_methods*.10);
I need to show bids having highest weightage value on top. I am confused about the addition/subtraction of the weightage based on what is best for customer i.e if price is lower then this should be considered best for customer and should I add weightage or subtract weightage?
Any help would be appreciated. Thanks