Answer the question
In order to leave comments, you need to log in
Why not display a selection from the database with prestashop?
public static function getShiftFromOrderForEmail($id_order){
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(
'select s.time_from
from `'._DB_PREFIX_.'shift` as s
join `'._DB_PREFIX_.'1c_orders` as c on c.id_shift = s.id_shift
join `'._DB_PREFIX_.'orders` as o on o.id_order = c.id_order
where o.id_order = '.(int)$id_order );
$res2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('select s.time_from, s.time_to
from ps_shift as s
join ps_1c_orders as c on c.id_shift = s.id_shift
join ps_orders as o on o.id_cart = c.id_c
where o.id_order = 555'.(int)$id_order );
$sql = new DbQuery();
$sql->select('CONCAT(s.time_from, " - " ,s.time_to )');
$sql->from('shift','s');
$sql->innerJoin('1c_orders', 'c' , 'c.id_shift = s.id_shift')
$sql->innerJoin('orders', 'o' , 'o.id_order = c.id_order')
$sql->where('o.id_order = '.(int)$id_order);
$result = Db::getInstance()->getRow($sql);
Db::getInstance()->getMsgError();
return $result ? $result : 'none';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question