ricardovtav Posted July 5, 2013 Share Posted July 5, 2013 Good morning friends, as I put the number of products sold in each product in homefeatured? thank you Link to comment Share on other sites More sharing options...
Martin Uker K Posted July 5, 2013 Share Posted July 5, 2013 Hi, Not sure, I think you are asking us HOW TO right? You want to keep a track of how much unity of this product you sold and display it? I'm quite confused with your post. It's not really a question neither an affirmation...Please be more specific. Martin Link to comment Share on other sites More sharing options...
ricardovtav Posted July 5, 2013 Author Share Posted July 5, 2013 exactly, would that visitors could see how many items were sold of each product. Link to comment Share on other sites More sharing options...
Martin Uker K Posted July 5, 2013 Share Posted July 5, 2013 (edited) Okay....That's not the easiest thing to do. Simply put : The featured product module give an list of ARRAY that represents a product, each of them. These arrays are generated by Category.php (class), using the function getProducts. I can't write you all the code since I don't need it (Free work ain't my type). But I can tell you what needs to be done : You'll need to overide Category class and function getProducts to add the product number either in the SQL request (Best way for quality) OR call the parent function and add manually in PHP the count (Easier but can affect the performance whne you load a lot of products). Hint for the mysql and php version : check or use ProductSale::getNbrSales($id_product). Good luck with that. Edited July 5, 2013 by Martin Uker K (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 6, 2013 Share Posted July 6, 2013 but what kind of tables it's necessary to include to the sql query? stats? Link to comment Share on other sites More sharing options...
Recommended Posts