x-ray Posted December 21, 2005 Report Share Posted December 21, 2005 Hi there, i have found some logic bugs in new_products.php module and whats new box : they are showing any products orderderd by date added, not only true new products : in new_products.php we have statment that will set range of product selection to only new products : if (MAX_DISPLAY_NEW_PRODUCTS_DAYS != '0') { $date_new_products = date("Y.m.d", mktime(1, 1, 1, date(m), date(d) - MAX_DISPLAY_NEW_PRODUCTS_DAYS, date(Y))); $days = " and p.products_date_added > '".$date_new_products."' "; } but its newer used in any query, so we must add this for both queries : for an example : . . . ".$fsk_lock." ".$days." . . . same thing with box whats_new, but we must add this statment : if (MAX_DISPLAY_NEW_PRODUCTS_DAYS != '0') { $date_new_products = date("Y.m.d", mktime(1, 1, 1, date(m), date(d) - MAX_DISPLAY_NEW_PRODUCTS_DAYS, date(Y))); $days = " and p.products_date_added > '".$date_new_products."' "; } now this module will show correct new producs, also this select query isn't optimized : $new_products_query = "SELECT * FROM its sellects all data from 4 biggest tables (in most cases) , but uses only few fields You can replace it byt this one : $new_products_query = "SELECT p.products_id, pd.products_name, pd.products_short_description, p.products_price, p.products_tax_class_id, p.products_image, FROM This should speed up much more selection of new products. Link to comment Share on other sites More sharing options...
x-ray Posted December 21, 2005 Author Report Share Posted December 21, 2005 $new_products_query = "SELECT p.products_id, pd.products_name, pd.products_short_description, p.products_price, p.products_tax_class_id, p.products_image FROM without " , " after : p.products_image Link to comment Share on other sites More sharing options...
oops Posted July 13, 2006 Report Share Posted July 13, 2006 Sorry I'm a little bit to stupid for php-details. On witch place we have to add ".$fsk_lock." ".$days." exactly? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.