add default account to frontend

This commit is contained in:
2015-10-26 07:49:10 +01:00
parent 0c92fdf167
commit 01da3c470c
45 changed files with 948 additions and 220 deletions

View File

@@ -68,6 +68,15 @@ class CustomerCreate extends \common\models\Customer
[['email'], 'string', 'max' => 255],
[['email'], 'email' ],
[['email'], 'unique' ],
[['email'], 'required', 'when' => function($model) {
return !isset( $model->email ) || empty($model->phone) ;
} ,
// 'enableClientValidation' => false,
'whenClient' => "function (attribute, value) {
return false;
}",
'message' => Yii::t('customer/frontend','E-mail or phone number required!')
],
[['password_plain','password_repeat'], 'string', 'max' => 32],
@@ -80,13 +89,24 @@ class CustomerCreate extends \common\models\Customer
[['phone', 'tax_number', 'country'], 'string', 'max' => 20],
[['phone'], 'required', 'when' => function($model) {
return !isset( $model->email ) || empty( $model->email ) ;
} ,
// 'enableClientValidation' => false,
'whenClient' => "function (attribute, value) {
return false;
}",
'message' => Yii::t('customer/frontend','E-mail or phone number required!')
],
[['zip'], 'string', 'max' => 8],
[['city'], 'string', 'max' => 30]
[['city'], 'string', 'max' => 30],
// [['email','phone'], 'validateEmailOrPhoneRequired' ],
];
}
public function validateCustomerCard($a,$p){
$card = null;