PDA

View Full Version : Happy Hours Specials Basic



michael_s
02-05-2008, 03:21 AM
Hello!

Bug fix in db query

Please replace in (catalog)/includes/boxes/happy_hours_specials_basic.php

line 20:
if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, hhs.specials_price_happy_hours, hhs.status_happy_hours, hhs.happy_hours_beginning_date, hhs.happy_hours_end_date, hhs.happy_hours_beginning_time, hhs.happy_hours_end_time, hhs.specials_date_added from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_HAPPY_HOURS_SPECIALS_BASIC . " hhs where p.products_status = '1' and p.products_id = hhs.products_id and pd.products_id = hhs.products_id and pd.language_id = '" . (int)$languages_id . "' and hhs.status_happy_hours = '1' and '" . $uhrzeit . "' BETWEEN hhs.happy_hours_beginning_time and hhs.happy_hours_end_time and now() > hhs.happy_hours_beginning_date and now() < hhs.happy_hours_end_date order by hhs.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {

on good code:
if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, hhs.specials_price_happy_hours, hhs.status_happy_hours, hhs.happy_hours_beginning_date, hhs.happy_hours_end_date, hhs.happy_hours_beginning_time, hhs.happy_hours_end_time, hhs.specials_date_added from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_HAPPY_HOURS_SPECIALS_BASIC . " hhs where p.products_status = '1' and p.products_id = hhs.products_id and pd.products_id = hhs.products_id and pd.language_id = '" . (int)$languages_id . "' and hhs.status_happy_hours = '1' and '" . $time . "' BETWEEN hhs.happy_hours_beginning_time and hhs.happy_hours_end_time and hhs.happy_hours_beginning_date