public function init()
 {
     $this->name = \Yii::t('skeeks/shop/app', 'Payment systems');
     $this->modelShowAttribute = "name";
     $this->modelClassName = ShopPaySystem::className();
     parent::init();
 }
 public function init()
 {
     $this->name = \skeeks\cms\shop\Module::t('app', 'Payment systems');
     $this->modelShowAttribute = "name";
     $this->modelClassName = ShopPaySystem::className();
     parent::init();
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPaySystem()
 {
     return $this->hasOne(ShopPaySystem::className(), ['id' => 'pay_system_id']);
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPaySystems()
 {
     return $this->hasMany(ShopPaySystem::className(), ['id' => 'pay_system_id'])->viaTable('shop_pay_system_person_type', ['person_type_id' => 'id']);
 }
Example #5
0
 /**
  * Доступные платежные системы
  *
  * @return ShopPaySystem[]
  */
 public function getPaySystems()
 {
     return $this->personType->getPaySystems()->andWhere([ShopPaySystem::tableName() . ".active" => Cms::BOOL_Y]);
 }
Example #6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getShopPaySystems()
 {
     return $this->hasMany(ShopPaySystem::className(), ['id' => 'pay_system_id'])->viaTable('shop_delivery2pay_system', ['delivery_id' => 'id']);
 }
Example #7
0
    </div>

    <div class="row">

        <div class="col-md-8">
            <?php 
echo $form->field($model, 'logo_id')->widget(\skeeks\cms\widgets\formInputs\StorageImage::className());
?>
        </div>

    </div>



<?php 
echo $form->fieldSetEnd();
echo $form->fieldSet(\Yii::t('skeeks/shop/app', 'Payment systems'));
?>

    <?php 
echo $form->field($model, 'shopPaySystems')->checkboxList(\yii\helpers\ArrayHelper::map(\skeeks\cms\shop\models\ShopPaySystem::find()->active()->all(), 'id', 'name'))->hint(\Yii::t('skeeks/shop/app', 'if nothing is selected, it means all'));
?>

<?php 
echo $form->fieldSetEnd();
?>

<?php 
echo $form->buttonsCreateOrUpdate($model);
ActiveForm::end();
Example #8
0
 /**
  * Доступные платежные системы
  *
  * @return ShopPaySystem[]
  */
 public function getPaySystems()
 {
     if (!$this->personType) {
         $query = ShopPaySystem::find()->andWhere([ShopPaySystem::tableName() . ".active" => Cms::BOOL_Y]);
         $query->multiple = true;
         return $query;
     }
     return $this->personType->getPaySystems()->andWhere([ShopPaySystem::tableName() . ".active" => Cms::BOOL_Y]);
 }