bryan choo Posted October 6, 2012 at 11:28 AM Share Posted October 6, 2012 at 11:28 AM Basically I want to display the "Average spent" for each listings, based on the number entered by people in their reviews. So I need a function that takes the values from that specific field in all the reviews. It adds them up and calculates it producing the "average spent". So something like this <?php echo round(((Sanitize::getVar($listing['review'],'sum_avg_spent') / $review_count)),1);?> Willing to pay whatever is a fair amount. There is also a few other stuff im looking forward to coding so there are more opportunities. To help get it started, this is what Alejandaro said The information is in the database, so performing the calculation is possible, but you'll need to get someone to help you do it because it's not simply adding a line of code in the theme file. You have to modify the afterFind method in the listing.php model to add the information to the $listings var so it becomes available in the theme file. My recommendation is that you post this in the freelancer board because this sort of request is outside the scope of support. Link to comment
bryan choo Posted October 6, 2012 at 12:04 PM Author Share Posted October 6, 2012 at 12:04 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Alejandro Posted October 6, 2012 at 02:08 PM Share Posted October 6, 2012 at 02:08 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Recommended Posts