Browse Source

Option paramètres producteur : autoriser ou non les utilisateurs à effectuer un don lors de leur commande

dev
Guillaume Bourgeois 5 years ago
parent
commit
1d053262bd
3 changed files with 24 additions and 1 deletions
  1. +6
    -0
      backend/views/producer/update.php
  2. +3
    -1
      common/models/Producer.php
  3. +15
    -0
      console/migrations/m190205_170712_ajout_option_autoriser_don_plateforme.php

+ 6
- 0
backend/views/producer/update.php View File

<?= $form->field($model, 'order_infos') <?= $form->field($model, 'order_infos')
->textarea(['rows' => 6]) ->textarea(['rows' => 6])
->hint('Affichées au client lors de sa commande')?> ->hint('Affichées au client lors de sa commande')?>
<?= $form->field($model, 'option_allow_user_gift')
->dropDownList([
0 => 'Non',
1 => 'Oui',
], []) ; ?>
</div> </div>
</div> </div>



+ 3
- 1
common/models/Producer.php View File

* @property boolean online_payment * @property boolean online_payment
* @property string mentions * @property string mentions
* @property string gcs * @property string gcs
* @property boolean option_allow_user_gift
*/ */
class Producer extends ActiveRecordCommon class Producer extends ActiveRecordCommon
{ {
} }
}], }],
[['description','mentions','gcs','order_infos','slug','secret_key_payplug'], 'string'], [['description','mentions','gcs','order_infos','slug','secret_key_payplug'], 'string'],
[['negative_balance', 'credit', 'active','online_payment','user_manage_subscription'], 'boolean'],
[['negative_balance', 'credit', 'active','online_payment','user_manage_subscription', 'option_allow_user_gift'], 'boolean'],
[['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code','type'], 'string', 'max' => 255], [['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code','type'], 'string', 'max' => 255],
[['free_price', 'credit_limit_reminder'], 'double'], [['free_price', 'credit_limit_reminder'], 'double'],
['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'], ['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'],
'user_manage_subscription' => 'Autoriser les utilisateurs à gérer leurs abonnements', 'user_manage_subscription' => 'Autoriser les utilisateurs à gérer leurs abonnements',
'mentions' => 'Mentions légales', 'mentions' => 'Mentions légales',
'gcs' => 'Conditions générales de vente', 'gcs' => 'Conditions générales de vente',
'option_allow_user_gift' => 'Autoriser les utilisateurs à effectuer un don à la plateforme lors de leur commande',
]; ];
} }



+ 15
- 0
console/migrations/m190205_170712_ajout_option_autoriser_don_plateforme.php View File

<?php

use yii\db\Migration;
use yii\db\mysql\Schema;

class m190205_170712_ajout_option_autoriser_don_plateforme extends Migration {

public function up() {
$this->addColumn('producer', 'option_allow_user_gift', Schema::TYPE_BOOLEAN.' DEFAULT 1') ;
}

public function down() {
$this->dropColumn('producer', 'option_allow_user_gift') ;
}
}

Loading…
Cancel
Save