Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Advanced Search Date_From and Date_To results


Nick Lim

Recommended Posts

I found that the Advanced Search results do not include products for the date specified in the Date_To field.

Is there anyway to make the results include products which were added on the date entered in the Date_To field ?

Link to comment
Share on other sites

Make sure you have the following code in your advanced_search_result.php file

 

  if (tep_not_null($dto)) {

   $where_str .= " and p.products_date_added <= '" . tep_date_raw($dto) . "'";

 }

 

must have the <= in the code

Reddy to Rumble

 

Thank you osCommerce and all who Contribute to her!

Link to comment
Share on other sites

A Reddy - Thanks for the prompt reply.

 

I have the codes you mentioned in the Advanced Search Result file.

My problem is that the search result shows all products added with dates up to one day before the date specified in the Date_To field.

 

These are my codes :

 

if (isset($HTTP_GET_VARS['dfrom']) && tep_not_null($HTTP_GET_VARS['dfrom']) && ($HTTP_GET_VARS['dfrom'] != DOB_FORMAT_STRING)) {

$where_str .= " and p.products_date_added >= '" . tep_date_raw($dfrom_to_check) . "'";

}

 

if (isset($HTTP_GET_VARS['dto']) && tep_not_null($HTTP_GET_VARS['dto']) && ($HTTP_GET_VARS['dto'] != DOB_FORMAT_STRING)) {

$where_str .= " and p.products_date_added <= '" . tep_date_raw($dto_to_check) . "'";

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...