37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* TNT OFFICIAL MODULE FOR PRESTASHOP.
|
|
*
|
|
* @author GFI Informatique <www.gfi.fr>
|
|
* @copyright 2016-2017 GFI Informatique, 2016-2017 TNT
|
|
* @license https://opensource.org/licenses/MIT MIT License
|
|
*/
|
|
|
|
require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php';
|
|
require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php';
|
|
|
|
class TNTOfficiel_OrderSmartyFunction
|
|
{
|
|
/**
|
|
* @param $data array
|
|
* @param $smarty
|
|
*
|
|
* @return bool|string
|
|
*/
|
|
public function getTntOrder($data, $smarty)
|
|
{
|
|
TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__));
|
|
|
|
try {
|
|
$arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($data['orderId']);
|
|
$smarty->assign('tntOrderData', $arrTNTOrder);
|
|
|
|
return (is_string($arrTNTOrder)) ? $arrTNTOrder : null;
|
|
} catch (Exception $objException) {
|
|
$smarty->assign('tntOrderData', false);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|