Ejemplo n.º 1
0
 public function __construct($id = null, $id_lang = null)
 {
     parent::__construct($id, $id_lang);
     // $this->def['fields']['delivery_date'] = array('type' => self::TYPE_DATE, 'validate' => 'isDate');
     // $this->def['fields']['delivery_time_from'] = array('type' => self::TYPE_STRING, 'validate' => 'isGenericName');
     // $this->def['fields']['delivery_time_to'] = array('type' => self::TYPE_STRING, 'validate' => 'isGenericName');
 }
Ejemplo n.º 2
0
 public function __construct($id = null, $id_lang = null)
 {
     parent::__construct($id);
     if (!is_null($id_lang)) {
         $this->id_lang = (int) (Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT');
     }
     if ($this->id_customer) {
         if (isset(Context::getContext()->customer) && Context::getContext()->customer->id == $this->id_customer) {
             $customer = Context::getContext()->customer;
         } else {
             $customer = new Customer((int) $this->id_customer);
         }
         Cart::$_customer = $customer;
         if ((!$this->secure_key || $this->secure_key == '-1') && $customer->secure_key) {
             $this->secure_key = $customer->secure_key;
             $this->save();
         }
     }
     $this->setTaxCalculationMethod();
 }