pars Posted May 4, 2008 Share Posted May 4, 2008 how do I set the best seller box to show the best sold products in a certain period of time? e.g. best sellers in past 4 weeks. thanks :) Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted May 4, 2008 Share Posted May 4, 2008 The qty in products ordered is total sold since the shop opened. You could zeroise the qty ordered and then recalculate the qty sold in the last x days and use that. First part is update products set products_ordered = 0 Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted May 4, 2008 Share Posted May 4, 2008 And part 2a is SELECT products_id,SUM(products_quantity) FROM orders_products GROUP BY products_id Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
dmnalven Posted May 4, 2008 Share Posted May 4, 2008 nevermind For ALL problems, please review this link first -> osCommerce Knowledge Base Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted May 4, 2008 Share Posted May 4, 2008 And this is part 2b SELECT op.products_id, SUM( op.products_quantity ) FROM orders_products op, orders o WHERE o.orders_id = op.orders_id AND datediff(now(), o.date_purchased) < 28 GROUP BY op.products_id off to dev.mysql.com again Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted May 4, 2008 Share Posted May 4, 2008 This seems to do it update products set products_ordered = 0 UPDATE products p SET products_ordered = ( SELECT SUM( op.products_quantity ) FROM orders_products op, orders o WHERE p.products_id = op.products_id AND o.orders_id = op.orders_id AND datediff( now(), o.date_purchased) < 28 GROUP BY op.products_id ) But don't trust me, backup first. Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
pars Posted May 7, 2008 Author Share Posted May 7, 2008 thanks for your answer dear "geoffreywalton". that was great. but assume that I'm newbie! :S would you mind explain for me in more simple words? where should make these changes in my shop and does it have modules to do such a thing? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.