Beispiel #1
0
 public function loadDefaultValues($skipIfSet = true)
 {
     parent::loadDefaultValues($skipIfSet);
     if (!$this->site_id) {
         $this->site_id = \Yii::$app->cms->site->id;
     }
     if (!$this->delivery_id) {
         //$this->delivery_id = \Yii::$app->cms->site->id;
     }
     if (!$this->person_type_id && \Yii::$app->shop->shopPersonTypes) {
         $shopPersonType = \Yii::$app->shop->shopPersonTypes[0];
         $this->person_type_id = $shopPersonType->id;
     }
     if (!$this->pay_system_id && $this->paySystems) {
         $paySystem = $this->paySystems[0];
         $this->pay_system_id = $paySystem->id;
     }
     $deliveries = \skeeks\cms\shop\models\ShopDelivery::find()->active()->all();
     if (!$this->delivery_id && $deliveries) {
         $delivery = $deliveries[0];
         $this->delivery_id = $delivery->id;
     }
 }