diff --git a/frontend/views/layouts/_basket_modal.php b/frontend/views/layouts/_basket_modal.php
new file mode 100644
index 0000000..a5c9677
--- /dev/null
+++ b/frontend/views/layouts/_basket_modal.php
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+
+
+
+ get('basket');
+ $data = $basket->getData();
+ $variants = [];
+ if (!empty($data)) {
+ $variants = $basket->findModels(array_keys($data));
+ }
+ $formatter = \Yii::$app->formatter;
+ $sum = 0;
+ $sumDiscount = 0;
+ foreach ($basket->findModels(array_keys($basket->getData())) as $variant) {
+ $count = $basket->getItem($variant->id)[ 'count' ];
+ $sum += $variant->price * $count;
+ if (!empty($variant->price_old)) {
+ $sumDiscount += ( $variant->price_old - $variant->price ) * $count;
+ }
+ }
+
+ if (!empty($variants)) {
+ ?>
+
+
+
+
+
+
+ Итоговый счет
+
+
+
+
+
+
+
+
+ asDecimal($sum, 2); ?>
+
+
+
+ asDecimal($sumDiscount, 2); ?>
+
+
+
+ asDecimal($sum, 2); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'fa fa-' ]),
+ [ 'checkout/info' ],
+ [
+ 'class' => 'btn btn-success',
+ ]
+ )
+ ?>
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/views/layouts/_category_menu.php b/frontend/views/layouts/_category_menu.php
index 200a9a4..bd8bdec 100755
--- a/frontend/views/layouts/_category_menu.php
+++ b/frontend/views/layouts/_category_menu.php
@@ -15,42 +15,46 @@
>
- -
- lang->title,
- [
- 'category/view',
- 'category' => $category->lang->alias->value,
- ],
- [
- 'tabindex' => -1,
- ]
- );
- if (!empty( $category->categories )) {
- ?>
+ if ($category->lang->alias) {
+ ?>
+
-
+ lang->title,
+ [
+ 'category/view',
+ 'category' => $category->lang->alias->value,
+ ],
+ [
+ 'tabindex' => -1,
+ ]
+ );
+ if (!empty($category->categories)) {
+ ?>
categories as $childCategory) {
- echo Html::tag(
- 'li',
- Html::a(
- $childCategory->lang->title,
- [
- 'category/view',
- 'category' => $childCategory->lang->alias->value,
- ]
- )
- );
+ if ($childCategory->lang->alias) {
+ echo Html::tag(
+ 'li',
+ Html::a(
+ $childCategory->lang->title,
+ [
+ 'category/view',
+ 'category' => $childCategory->lang->alias->value,
+ ]
+ )
+ );
+ }
}
?>
-
-
-
+
+
diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php
index 3b3eb9a..17504d7 100755
--- a/frontend/views/layouts/main.php
+++ b/frontend/views/layouts/main.php
@@ -6,7 +6,6 @@
* @var User $user
*/
use artbox\core\components\SeoComponent;
- use artbox\core\helpers\ImageHelper;
use artbox\core\models\Feedback;
use artbox\core\models\Image;
use artbox\core\models\Page;
@@ -181,7 +180,7 @@ _________________________________________________________ -->
'logo',
]
@@ -257,29 +256,29 @@ _________________________________________________________ -->
+
+
+
+
+ + +
+
+ get('basket');
+ $data = $basket->getData();
+ $variants = [];
+ if (!empty($data)) {
+ $variants = $basket->findModels(array_keys($data));
+ }
+ $formatter = \Yii::$app->formatter;
+ $sum = 0;
+ $sumDiscount = 0;
+ foreach ($basket->findModels(array_keys($basket->getData())) as $variant) {
+ $count = $basket->getItem($variant->id)[ 'count' ];
+ $sum += $variant->price * $count;
+ if (!empty($variant->price_old)) {
+ $sumDiscount += ( $variant->price_old - $variant->price ) * $count;
+ }
+ }
+
+ if (!empty($variants)) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Итоговый счет
+
+
+
+
+
+ + | asDecimal($sum, 2); ?> | +
---|---|
+ | asDecimal($sumDiscount, 2); ?> | +
+ | asDecimal($sum, 2); ?> | +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'fa fa-' ]),
+ [ 'checkout/info' ],
+ [
+ 'class' => 'btn btn-success',
+ ]
+ )
+ ?>
+
+ -
categories as $childCategory) {
- echo Html::tag(
- 'li',
- Html::a(
- $childCategory->lang->title,
- [
- 'category/view',
- 'category' => $childCategory->lang->alias->value,
- ]
- )
- );
+ if ($childCategory->lang->alias) {
+ echo Html::tag(
+ 'li',
+ Html::a(
+ $childCategory->lang->title,
+ [
+ 'category/view',
+ 'category' => $childCategory->lang->alias->value,
+ ]
+ )
+ );
+ }
}
?>