public function initContent()
 {
     $admin_seur = new AdminSeur(false);
     if (!$admin_seur->module_enabled_and_configured) {
         $admin_seur->displayModuleConfigurationWarning();
         $this->content = $admin_seur->content;
         return parent::initContent();
     }
     $this->display = 'view';
     $this->module_instance = Module::getInstanceByName('seur');
     Context::getContext()->controller->addJqueryUI('ui.datepicker');
     if (Tools::getValue('verDetalle')) {
         $response = Expedition::getExpeditions($admin_seur->getExpeditionData());
         $this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries($response, true));
     } elseif (Tools::getValue('createPickup')) {
         $error_response = Pickup::createPickup();
         if (!empty($error_response)) {
             $this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries(null, null, $error_response));
         } else {
             $this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries());
         }
     } elseif (Tools::getValue('submitFilter')) {
         $response = Expedition::getExpeditions($admin_seur->getExpeditionData());
         $this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries($response, false));
     } else {
         $this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries());
     }
     $this->content = $admin_seur->content;
     $this->fields_list = $admin_seur->fields_list;
     parent::initContent();
 }
Ejemplo n.º 2
0
 public function hookOrderDetailDisplayed($params)
 {
     if (Configuration::get('SEUR_Configured') == 1) {
         $seur_carriers = SeurLib::getSeurCarriers(false);
         $ids_seur_carriers = array();
         foreach ($seur_carriers as $value) {
             $ids_seur_carriers[] = (int) $value['id'];
         }
         $order = new Order((int) $params['order']->id);
         if (!Validate::isLoadedObject($order)) {
             return false;
         }
         if (in_array((int) $order->id_carrier, $ids_seur_carriers)) {
             $referencia = sprintf('%06d', (int) $order->id);
             $datos = array();
             $datos['reference_number'] = $referencia;
             $response = Expedition::getExpeditions($datos);
             $string_xml = htmlspecialchars_decode($response->out);
             $xml = simplexml_load_string($string_xml);
             $seur_order_state = $xml->EXPEDICION->DESCRIPCION_PARA_CLIENTE;
             $this->context->smarty->assign(array('logo' => $this->_path . 'img/logo.png', 'reference' => $datos['reference_number'], 'delivery' => (string) $xml->EXPEDICION->EXPEDICION_NUM, 'seur_order_state' => !empty($seur_order_state) ? (string) $seur_order_state : $this->l('Sin estado'), 'date' => (string) $xml->EXPEDICION->FECHA_CAPTURA));
             return $this->display(__FILE__, 'views/templates/hook/orderDetail.tpl');
         }
     }
 }
Ejemplo n.º 3
0
 public function initContent()
 {
     $this->display = 'view';
     if (Tools::getValue('verDetalle')) {
         $response = Expedition::getExpeditions($this->getExpeditionData());
         $this->tpl_view_vars = array('datos' => $this->displayFormDeliveries($response, true));
     } elseif (Tools::getValue('createPickup')) {
         $error_response = Pickup::createPickup();
         if (!empty($error_response)) {
             $this->tpl_view_vars = array('datos' => $this->displayFormDeliveries(null, null, $error_response));
         } else {
             $this->tpl_view_vars = array('datos' => $this->displayFormDeliveries());
         }
     } elseif (Tools::getValue('submitFilter')) {
         $response = Expedition::getExpeditions($this->getExpeditionData());
         $this->tpl_view_vars = array('datos' => $this->displayFormDeliveries($response, false));
     } else {
         $this->tpl_view_vars = array('datos' => $this->displayFormDeliveries());
     }
 }