コード例 #1
0
ファイル: Range.php プロジェクト: tomideru/PrestaShop-modules
 private static function init()
 {
     self::$ranges = array(0 => 2, 2 => 3, 3 => 5, 5 => 10, 10 => 11, 11 => 12, 12 => 13, 13 => 14, 14 => 15);
     $historyTable = SeurLib::getSeurCarriers();
     if (!empty($historyTable)) {
         foreach ($historyTable as $historyCarrier) {
             switch ($historyCarrier['type']) {
                 case 'SEN':
                     self::$carrier_seur = new Carrier((int) $historyCarrier['id']);
                     self::$carrier_seur->active = 1;
                     self::$carrier_seur->deleted = 0;
                     break;
                 case 'SEP':
                     self::$carrier_pos = new Carrier((int) $historyCarrier['id']);
                     self::$carrier_pos->active = 0;
                     self::$carrier_pos->deleted = 0;
                     break;
                 case 'SCN':
                     self::$carrier_canarias_m = new Carrier((int) $historyCarrier['id']);
                     self::$carrier_canarias_m->active = 1;
                     self::$carrier_canarias_m->deleted = 0;
                     break;
                 case 'SCE':
                     self::$carrier_canarias_48 = new Carrier((int) $historyCarrier['id']);
                     self::$carrier_canarias_48->active = 1;
                     self::$carrier_canarias_48->deleted = 0;
                     break;
                 default:
             }
         }
     }
 }
コード例 #2
0
ファイル: seur.php プロジェクト: tomideru/PrestaShop-modules
 public function hookExtraCarrier()
 {
     if (Configuration::get('SEUR_Configured') == 1) {
         $process_type = Configuration::get('PS_ORDER_PROCESS_TYPE');
         $seur_carrier_pos = SeurLib::getSeurCarrier('SEP');
         $seur_carriers = SeurLib::getSeurCarriers(true);
         $pos_is_enabled = SeurLib::getConfigurationField('pos');
         $seur_carriers_without_pos = '';
         foreach ($seur_carriers as $seur_carrier) {
             if ($seur_carrier['id'] != $seur_carrier_pos['id']) {
                 $seur_carriers_without_pos .= (int) $seur_carrier['id'] . ',';
             }
         }
         $seur_carriers_without_pos = trim($seur_carriers_without_pos, ',');
         if ($process_type == '0') {
             $this->context->smarty->assign('id_address', $this->context->cart->id_address_delivery);
         }
         $this->context->smarty->assign(array('posEnabled' => $pos_is_enabled, 'id_seur_pos' => (int) $seur_carrier_pos['id'], 'seur_resto' => $seur_carriers_without_pos, 'src' => $this->_path . 'img/unknown.gif', 'ps_version' => version_compare(_PS_VERSION_, '1.5', '<') ? 'ps4' : 'ps5'));
         return $this->display(__FILE__, 'views/templates/hook/seur.tpl');
     }
 }