Updated search form, added new hooks, updated cart to support time along with date

This commit is contained in:
Shreesh Arora
2024-09-06 10:39:07 +05:30
parent 9d4aaa8541
commit 03094d2108
16 changed files with 100 additions and 163 deletions

View File

@@ -141,11 +141,11 @@ class CategoryControllerCore extends FrontController
$id_category = Tools::getValue('id_category');
if (!($date_from = Tools::getValue('date_from'))) {
$date_from = date('Y-m-d');
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
$date_from = date('Y-m-d H:i:s');
$date_to = date('Y-m-d H:i:s', strtotime($date_from) + 86400);
}
if (!($date_to = Tools::getValue('date_to'))) {
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
$date_to = date('Y-m-d H:i:s', strtotime($date_from) + 86400);
}
// get occupancy of the search
@@ -160,9 +160,9 @@ class CategoryControllerCore extends FrontController
if ($preparationTime
&& strtotime('+ '.$preparationTime.' day') >= strtotime($date_from)
) {
$date_from = date('Y-m-d', strtotime('+ '.$preparationTime.' day'));
$date_from = date('Y-m-d H:i:s', strtotime('+ '.$preparationTime.' day'));
if (strtotime($date_from) >= strtotime($date_to)) {
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
$date_to = date('Y-m-d H:i:s', strtotime($date_from) + 86400);
}
}