public function generateEmailForgotPassword()
 {
     if (!empty($emailTo = $this->email)) {
         $mail = new Mail();
         $mail->to = $emailTo;
         $mail->subject = Yii::t('app', 'Information from {store_name}', ['store_name' => Property::getPropertyValue('store_name', '')]);
         $mail->body = StoreUtils::renderView('//mail/_destination_forgot_password', ['model' => $this]);
         $mail->save();
     }
 }
Example #2
0
 public function actionComment()
 {
     $model = new CommentForm();
     if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
         Yii::$app->session->setFlash('commentFormSubmitted');
         StoreUtils::sendPendingEmails();
         return $this->refresh();
     }
     return $this->render('comment', ['model' => $model]);
 }
Example #3
0
 /**
  * Sends an email to the specified email address using the information collected by this model.
  * @param  string  $email the target email address
  * @return boolean whether the model passes validation
  */
 public function contact($email)
 {
     if ($this->validate()) {
         $mail = new Mail();
         $mail->subject = $this->subject;
         $mail->body = StoreUtils::renderView('//mail/_contact', ['model' => $this]);
         $mail->to = $email;
         $mail->save();
         return true;
     }
     return false;
 }
Example #4
0
 /**
  * Sends an email to the specified email address using the information collected by this model.
  * @param  string  $email the target email address
  * @return boolean whether the model passes validation
  */
 public function contact($email)
 {
     if ($this->validate()) {
         $mail = new Mail();
         $mail->subject = Yii::t('app', 'Comment received on {store}', ['store' => Property::getPropertyValue('store_name', '')]);
         $mail->body = StoreUtils::renderView('//mail/_comment', ['model' => $this]);
         $mail->to = $email;
         $mail->save();
         return true;
     }
     return false;
 }
 public function actionForgotPassword()
 {
     $this->layout = 'login';
     $model = new AdminLoginForm();
     $show = 'login';
     $username = Yii::$app->request->post('username');
     /** @var DestinationAccount $destination */
     $destination = DestinationAccount::find()->where(['email' => $username])->one();
     if (!is_null($destination)) {
         $destination->generateEmailForgotPassword();
         StoreUtils::sendPendingEmails();
         $model->username = $destination->email;
         Yii::$app->session->setFlash('general-info', Yii::t('app', 'An email with the information you requested was successfully sent to {email}', ['email' => $destination->email]));
     } else {
         $show = 'password';
         Yii::$app->session->setFlash('password-error', Yii::t('app', 'The email address you provided could not be found'));
     }
     return $this->render('login', ['model' => $model, 'show' => $show]);
 }
 public function actionForgotPassword()
 {
     $username = Yii::$app->request->post('username');
     /** @var User $model */
     $model = User::find()->where(['email' => $username])->one();
     if (!is_null($model)) {
         $model->generateEmailForgotPassword();
         StoreUtils::sendPendingEmails();
     }
     return $this->renderPartial('_forgot_password', ['model' => $model]);
 }
Example #7
0
<?php

/* @var $this yii\web\View */
use app\components\StoreUtils;
$ids = StoreUtils::getProductIds(9);
$this->title = \app\models\Property::getPropertyValue('store_name', '');
?>
<div class="site-index">

    <div>
        <?php 
echo $this->render('//parts/_banner', ['zone' => 'home_top']);
?>
    </div>

    <div class="row" style="margin-top: 10px;">

        <div class="col-md-3">
            <?php 
echo $this->render('//layouts/_column_left');
?>
        </div>

        <div class="col-md-6">
            <?php 
echo $this->render('//parts/_products', ['ids' => $ids, 'template' => '_product_home', 'columns' => 3]);
?>
        </div>

        <div class="col-md-3">
            <div class="column_right">
Example #8
0
            </tbody>
            <tfoot>
            <tr style="font-size: 14pt;font-weight: bold;">
                <td colspan="2" style="border-top: 2px solid #666666;"><span style="font-weight: bold;"><?php 
echo Yii::t('app', 'Total');
?>
</span></td>
                <td colspan="3" style="border-top: 2px solid #666666;text-align: right;">
                    <span style="color:#AA0000;">$<?php 
echo number_format($model->total, 2, '.', '');
?>
</span>
                </td>
            </tr>
            </tfoot>
        </table>

        <?php 
if ($model->status == Order::STATUS_APPROVED) {
    echo StoreUtils::getBlockContent('order_approved_thanks', $language);
} else {
    if ($model->status == Order::STATUS_REJECTED) {
        echo StoreUtils::getBlockContent('order_rejected_thanks', $language);
    } else {
        echo StoreUtils::getBlockContent('order_pending_thanks', $language);
    }
}
?>
    </div>
</div>
Example #9
0
 public function updateURLCode($name = null)
 {
     if (empty($name)) {
         $name = $this->getName();
     }
     $code = StoreUtils::url_slug($name);
     $urlCode = $code;
     $exists = Category::find()->where('id<>:id and url_code=:code', [':id' => $this->id, ':code' => $urlCode])->exists();
     $index = 1;
     while ($exists) {
         $urlCode = $code . '-' . $index++;
         $exists = Category::find()->where('id<>:id and url_code=:code', [':id' => $this->id, ':code' => $urlCode])->exists();
     }
     $this->url_code = $urlCode;
     $this->save();
 }