Jump to content

PaymentModule and send an e-mail to customer, create new string{delivery}


maximP

Recommended Posts

$data = array(

...

on 718 '{shift}' => $this::getShiftFromOrderForEmail($order->id),

....

 

 

public static function getShiftFromOrderForEmail($id_order){
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(
'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' );  WORK!!!


$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';


}

 

 

Problem: none of these requests can not give the required information.
 
I tried to whether the value comes to $id_order - it comes.
Text output, return it through output.
But I needed a request is not working. Help!
Edited by maximP (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...