#1 (permalink)  
Alt 21.12.2005, 11:06
 
Registriert seit: 24.06.2005
Beiträge: 3
Standard

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 :
Code:
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 :

Code:
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 :
Code:
$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 :

Code:
$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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #2 (permalink)  
Alt 21.12.2005, 11:08
 
Registriert seit: 24.06.2005
Beiträge: 3
Standard

Code:
$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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #3 (permalink)  
Alt 13.07.2006, 21:23
 
Registriert seit: 14.09.2005
Beiträge: 6
Standard

Sorry I'm a little bit to stupid for php-details.

On witch place we have to add

".$fsk_lock."
".$days."


exactly?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
bugs, newproductsphp, whatsnewphp

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus



Alle Zeitangaben in WEZ +1. Es ist jetzt 09:38 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand