Пример #1
0
 public function actionOrder($id, $token)
 {
     $order = Shopcart::order($id);
     if (!$order || $order->access_token != $token) {
         throw new NotFoundHttpException('Order not found');
     }
     return $this->render('order', ['order' => $order]);
 }
Пример #2
0
 public function actionIndex()
 {
     $model = new Order();
     $request = Yii::$app->request;
     if ($model->load($request->post())) {
         $returnUrl = Shopcart::send($model->attributes) ? $request->post('successUrl') : $request->post('errorUrl');
         return $this->redirect($returnUrl);
     } else {
         return $this->redirect(Yii::$app->request->baseUrl);
     }
 }
Пример #3
0
                        <p> <?php 
    echo Yii::t('easyii', 'final total Price');
    ?>
                            <span class="pull-right">
                                <?php 
    if (\Yii::$app->language == 'ar') {
        echo "ج.م";
    }
    ?>
                                <?php 
    if (\Yii::$app->language == 'en') {
        echo "LE";
    }
    ?>
                                <?php 
    echo Shopcart::cost() + $delivery;
    ?>
                            </span>
                        </p>
                    </div>
                </div>
                <?php 
    echo Html::endForm();
    ?>


            <?php 
} else {
    ?>
                <div class="col-md-6 order-online">
                    <br/><br/><br/><br/>
Пример #4
0
<?php

use yii\easyii\modules\shopcart\api\Shopcart;
use yii\easyii\modules\subscribe\api\Subscribe;
use yii\helpers\Url;
use yii\widgets\Breadcrumbs;
use yii\widgets\Menu;
use yii\easyii\models\Setting;
use yii\helpers\Html;
$goodsCount = count(Shopcart::goods());
$this->beginContent('@app/views/layouts/base.php');
?>



<header class="navbar navbar-fixed-top bs-docs-nav" id="top" role="banner">
<div class="search">
  <div class="container">
 <?php 
echo Html::beginForm(Url::to(['/search']), 'get');
?>
 <?php 
echo Html::textInput('text', $text, ['class' => 'form-control', 'placeholder' => '']);
?>
                        
<?php 
echo Html::endForm();
?>
</div>
</div>
  <div class="container">
Пример #5
0
                    <a href="<?php 
echo Url::to(['/shopcart']);
?>
" class="btn btn-default navbar-btn navbar-right" title="Complete order">
                        <i class="glyphicon glyphicon-shopping-cart"></i>
                        <?php 
if ($goodsCount > 0) {
    ?>
                            <?php 
    echo $goodsCount;
    ?>
 <?php 
    echo $goodsCount > 1 ? 'items' : 'item';
    ?>
 - <?php 
    echo Shopcart::cost();
    ?>
&#8381;
                        <?php 
} else {
    ?>
                            <span class="text-muted">Пусто</span>
                        <?php 
}
?>
                    </a>

                </div>
            </div>
        </nav>
    </header>
Пример #6
0
 public function mailUser()
 {
     $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings;
     if (!$settings['mailUserOnNewOrder']) {
         return false;
     }
     /*
     var_dump(Page::get('order-success-user-mail-template')->getParsedText([
     	'name' => $data['name'],
     	'phone' => $data['phone'],
     	'email' => $data['email'],
     	'order_sum' => $model->cost,
     	'order_list' => $mainBehavior->formatOrderList($this->order)
     ]));
     */
     try {
         return Mail::send($this->email, $settings['subjectNotifyUser'], $settings['templateUserOnNewOrder'], ArrayHelper::merge(Shopcart::obj()->getBehavior('main')->prepareOrderEmailParameters($this), ['order' => $this]));
     } catch (\Swift_SwiftException $ex) {
         Yii::error('Отправка письма не удалась: ' . $ex->getMessage());
         return true;
     }
 }
Пример #7
0
                    <td colspan="5" class="text-right">
                        <h3>Всего: <?php 
    echo Shopcart::cost();
    ?>
<i class="fa fa-rub"></i></h3>
                    </td>
                </tr>
                </tbody>
            </table>
            <?php 
    echo Html::submitButton('<i class="glyphicon glyphicon-refresh"></i> Обновить', ['class' => 'btn btn-default pull-right']);
    ?>
            <?php 
    echo Html::endForm();
    ?>
        </div>
        <div class="col-md-4 col-md-offset-2">
            <h4>Получатель</h4>
            <div class="well well">
                <?php 
    echo Shopcart::form(['successUrl' => Url::to('/shopcart/success')]);
    ?>
            </div>
        </div>
    </div>
<?php 
} else {
    ?>
    <p>Корзина пуста</p>
<?php 
}
Пример #8
0
                            </div>
                        </div>

                   </div>


                    <footer>
                        <a class="btn dry-btn-2 shopping" href="/products/online" style="line-height:normal">
                            <?php 
echo Yii::t('easyii', 'Continue Shopping');
?>
</a>

                        <?php 
if (\yii\easyii\modules\shopcart\api\Shopcart::goods()) {
    $url = 'href="/shopcart"';
} else {
    $url = '  href="javascript:void(0)"  onclick="' . "\$('.alert').show()" . ' "';
}
?>
                        <a class="btn dry-btn-2 pull-right"  id="chanStat"  <?php 
echo $url;
?>
>
                            <?php 
echo Yii::t('easyii', 'Check Out');
?>
</a>
                    </footer>
                </div>
Пример #9
0
 public function mailUser()
 {
     $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings;
     if (!$settings['mailUserOnNewOrder']) {
         return false;
     }
     try {
         return Mail::send($this->model->email, $settings['subjectUserOnNewOrder'], $settings['templateUserOnNewOrder'], ArrayHelper::merge(Shopcart::obj()->getBehavior('main')->prepareOrderEmailParameters($this), ['order' => $this]));
     } catch (\Swift_SwiftException $ex) {
         Yii::error('Отправка письма не удалась: ' . $ex->getMessage());
         return true;
     }
 }