Пример #1
0
 /**
  * Show Kwixo evaluation status on detail order if kwixo order table contains orders
  * 
  * @param type $params
  * @return boolean
  */
 public function hookAdminOrder($params)
 {
     $id_order = $params['id_order'];
     $info_order = $this->getInfoKwixoOrder($id_order);
     $order = new Order((int) $id_order);
     if (!$info_order === false) {
         foreach ($info_order as $info) {
             $kwixo_tagline_state = $info['kwixo_tagline_state'];
             $transaction_id = $info['kwixo_transaction_id'];
             $date_tagline = $info['date_tagline'];
         }
         $show_last_tagline = $kwixo_tagline_state == NULL ? '0' : '1';
         if (_PS_VERSION_ < '1.5') {
             $kwixo = new KwixoPayment();
         } else {
             $kwixo = new KwixoPayment($order->id_shop);
         }
         $token = Tools::getAdminToken($kwixo->getSiteid() . $kwixo->getAuthkey() . $kwixo->getLogin());
         $this->smarty->assign(array('date_tagline' => $date_tagline, 'transaction_id' => $transaction_id, 'tag_tagline' => $kwixo_tagline_state, 'show_last_tagline' => $show_last_tagline, 'kwixo_statuses' => $this->_kwixo_order_statuses, 'id_order' => $id_order, 'tid' => $transaction_id, 'token' => $token, 'logo_kwixo' => __PS_BASE_URI__ . 'modules/' . $this->name . '/img/kwixo.png', 'img_loader' => __PS_BASE_URI__ . 'modules/' . $this->name . '/img/loader.gif'));
         return $this->display(__FILE__, '/views/templates/admin/tagline.tpl');
     } else {
         return false;
     }
 }
Пример #2
0
 *  @author PrestaShop SA <*****@*****.**>
 *  @copyright  2007-2014 PrestaShop SA
 *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */
include_once 'lib/includes/includes.inc.php';
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
include_once 'kwixo.php';
$id_order = Tools::getValue('id_order');
$order = new Order((int) $id_order);
if (_PS_VERSION_ < '1.5') {
    $kwixo = new KwixoPayment();
} else {
    $kwixo = new KwixoPayment($order->id_shop);
}
//token security
if (Tools::getValue('token') == Tools::getAdminToken($kwixo->getSiteid() . $kwixo->getAuthkey() . $kwixo->getLogin())) {
    $module = new Kwixo();
    $res = $kwixo->getTagline($order->id_cart, Tools::getValue('tid'));
    $tag = new KwixoTaglineResponse($res);
    $module->manageKwixoTagline($tag, $order, Tools::getValue('tid'));
    $info_order = $module->getInfoKwixoOrder($id_order);
    foreach ($info_order as $info) {
        $kwixo_tagline_state = $info['kwixo_tagline_state'];
        $date_tagline = $info['date_tagline'];
    }
    echo $tag . " => " . $module->_kwixo_order_statuses[$kwixo_tagline_state] . "__" . $date_tagline;
} else {
    header("Location: ../");
}