@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Menu module |
|
| 4 | - * |
|
| 5 | - * @author Alexey Krupskiy <[email protected]> |
|
| 6 | - * @link http://inji.ru/ |
|
| 7 | - * @copyright 2015 Alexey Krupskiy |
|
| 8 | - * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 9 | - */ |
|
| 3 | + * Menu module |
|
| 4 | + * |
|
| 5 | + * @author Alexey Krupskiy <[email protected]> |
|
| 6 | + * @link http://inji.ru/ |
|
| 7 | + * @copyright 2015 Alexey Krupskiy |
|
| 8 | + * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 9 | + */ |
|
| 10 | 10 | class Menu extends Module |
| 11 | 11 | { |
| 12 | 12 | |
@@ -17,30 +17,30 @@ discard block |
||
| 17 | 17 | ?> |
| 18 | 18 | <div class="filter"> |
| 19 | 19 | <?php |
| 20 | - switch ($option->type) { |
|
| 21 | - case 'radio': |
|
| 20 | + switch ($option->type) { |
|
| 21 | + case 'radio': |
|
| 22 | 22 | foreach ($option->items as $item) { |
| 23 | - $this->widget('Ui\Form/' . $option->type, [ |
|
| 24 | - 'label' => $item->name, |
|
| 25 | - 'name' => "filters[options][{$option->id}]", |
|
| 26 | - !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false, |
|
| 27 | - 'options' => [ |
|
| 28 | - 'value' => $item->id, |
|
| 29 | - ] |
|
| 30 | - ]); |
|
| 31 | - } |
|
| 32 | - break; |
|
| 33 | - default: |
|
| 23 | + $this->widget('Ui\Form/' . $option->type, [ |
|
| 24 | + 'label' => $item->name, |
|
| 25 | + 'name' => "filters[options][{$option->id}]", |
|
| 26 | + !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false, |
|
| 27 | + 'options' => [ |
|
| 28 | + 'value' => $item->id, |
|
| 29 | + ] |
|
| 30 | + ]); |
|
| 31 | + } |
|
| 32 | + break; |
|
| 33 | + default: |
|
| 34 | 34 | $this->widget('Ui\Form/' . $option->type, [ |
| 35 | - 'label' => $option->name, |
|
| 36 | - 'name' => "filters[options][{$option->id}]", |
|
| 37 | - 'options' => [ |
|
| 38 | - 'value' => !empty($_GET['filters']['options'][$option->id]) ? $_GET['filters']['options'][$option->id] : '', |
|
| 39 | - ] |
|
| 40 | - ]); |
|
| 41 | - } |
|
| 42 | - foreach ($option->items as $item) { |
|
| 43 | - ?> |
|
| 35 | + 'label' => $option->name, |
|
| 36 | + 'name' => "filters[options][{$option->id}]", |
|
| 37 | + 'options' => [ |
|
| 38 | + 'value' => !empty($_GET['filters']['options'][$option->id]) ? $_GET['filters']['options'][$option->id] : '', |
|
| 39 | + ] |
|
| 40 | + ]); |
|
| 41 | + } |
|
| 42 | + foreach ($option->items as $item) { |
|
| 43 | + ?> |
|
| 44 | 44 | <div class="radio"> |
| 45 | 45 | <label> |
| 46 | 46 | <input type="radio" name = 'filters[options][<?= $option->id; ?>]' value ="<?= $item->id; ?>" <?= !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : ''; ?>> |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | </label> |
| 49 | 49 | </div> |
| 50 | 50 | <?php |
| 51 | - } |
|
| 52 | - ?> |
|
| 51 | + } |
|
| 52 | + ?> |
|
| 53 | 53 | </div> |
| 54 | 54 | <?php |
| 55 | 55 | } |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Item name |
|
| 4 | - * |
|
| 5 | - * Info |
|
| 6 | - * |
|
| 7 | - * @author Alexey Krupskiy <[email protected]> |
|
| 8 | - * @link http://inji.ru/ |
|
| 9 | - * @copyright 2016 Alexey Krupskiy |
|
| 10 | - * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 11 | - */ |
|
| 3 | + * Item name |
|
| 4 | + * |
|
| 5 | + * Info |
|
| 6 | + * |
|
| 7 | + * @author Alexey Krupskiy <[email protected]> |
|
| 8 | + * @link http://inji.ru/ |
|
| 9 | + * @copyright 2016 Alexey Krupskiy |
|
| 10 | + * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 11 | + */ |
|
| 12 | 12 | |
| 13 | 13 | namespace Ecommerce; |
| 14 | 14 | |
@@ -1,19 +1,19 @@ |
||
| 1 | 1 | <div class="ecommerce-sidebar-categorys"> |
| 2 | 2 | <?php |
| 3 | - if(empty($category)){ |
|
| 4 | - $category = []; |
|
| 5 | - } |
|
| 6 | - $tree = new Ui\Tree(); |
|
| 7 | - $tree->ul('\Ecommerce\Category', 0, function($categoryItem) use($category) { |
|
| 8 | - if ($category && $category->id == $categoryItem->id) { |
|
| 9 | - $class = 'active'; |
|
| 10 | - } else { |
|
| 11 | - $class = ''; |
|
| 12 | - } |
|
| 13 | - return [ |
|
| 14 | - 'class' => $class, |
|
| 15 | - 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
| 16 | - ]; |
|
| 17 | - }); |
|
| 18 | - ?> |
|
| 3 | + if(empty($category)){ |
|
| 4 | + $category = []; |
|
| 5 | + } |
|
| 6 | + $tree = new Ui\Tree(); |
|
| 7 | + $tree->ul('\Ecommerce\Category', 0, function($categoryItem) use($category) { |
|
| 8 | + if ($category && $category->id == $categoryItem->id) { |
|
| 9 | + $class = 'active'; |
|
| 10 | + } else { |
|
| 11 | + $class = ''; |
|
| 12 | + } |
|
| 13 | + return [ |
|
| 14 | + 'class' => $class, |
|
| 15 | + 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
| 16 | + ]; |
|
| 17 | + }); |
|
| 18 | + ?> |
|
| 19 | 19 | </div> |
| 20 | 20 | \ No newline at end of file |
@@ -13,21 +13,21 @@ |
||
| 13 | 13 | <div class="ecommerce-best"> |
| 14 | 14 | <h2 class='caption'><span>Рекомендумые товары</span></h2> |
| 15 | 15 | <?php |
| 16 | - $bestItems = App::$cur->ecommerce->getItems(['where' => [['best', '1']], 'sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3]); |
|
| 17 | - if (count($bestItems) < 3) { |
|
| 18 | - $bestItems = array_merge($bestItems, App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3])); |
|
| 19 | - $bestItems = array_slice($bestItems, 0, 3); |
|
| 20 | - } |
|
| 21 | - $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
| 22 | - ?> |
|
| 16 | + $bestItems = App::$cur->ecommerce->getItems(['where' => [['best', '1']], 'sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3]); |
|
| 17 | + if (count($bestItems) < 3) { |
|
| 18 | + $bestItems = array_merge($bestItems, App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3])); |
|
| 19 | + $bestItems = array_slice($bestItems, 0, 3); |
|
| 20 | + } |
|
| 21 | + $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
| 22 | + ?> |
|
| 23 | 23 | </div> |
| 24 | 24 | </div> |
| 25 | 25 | <?php |
| 26 | - $this->widget('Ecommerce\items/showOptions'); |
|
| 26 | + $this->widget('Ecommerce\items/showOptions'); |
|
| 27 | 27 | |
| 28 | - $bestItems = App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 6]); |
|
| 29 | - $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
| 30 | - ?> |
|
| 28 | + $bestItems = App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 6]); |
|
| 29 | + $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
| 30 | + ?> |
|
| 31 | 31 | <a class="ecommerce-showmore" href="/ecommerce/itemList">Показать больше товаров</a> |
| 32 | 32 | </div> |
| 33 | 33 | </div> |
@@ -17,20 +17,20 @@ |
||
| 17 | 17 | <h1><?= $item->name(); ?></h1> |
| 18 | 18 | <ul class="item-options"> |
| 19 | 19 | <?php |
| 20 | - foreach ($item->options as $param) { |
|
| 21 | - if (!$param->item_option_view || !$param->value) |
|
| 22 | - continue; |
|
| 23 | - if ($param->item_option_type == 'select') { |
|
| 24 | - if (empty($param->option->items[$param->value])) |
|
| 25 | - continue; |
|
| 26 | - $value = $param->option->items[$param->value]->value; |
|
| 27 | - } else { |
|
| 28 | - $value = $param->value; |
|
| 29 | - } |
|
| 30 | - $paramName = $param->item_option_name; |
|
| 31 | - echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
| 32 | - } |
|
| 33 | - ?> |
|
| 20 | + foreach ($item->options as $param) { |
|
| 21 | + if (!$param->item_option_view || !$param->value) |
|
| 22 | + continue; |
|
| 23 | + if ($param->item_option_type == 'select') { |
|
| 24 | + if (empty($param->option->items[$param->value])) |
|
| 25 | + continue; |
|
| 26 | + $value = $param->option->items[$param->value]->value; |
|
| 27 | + } else { |
|
| 28 | + $value = $param->value; |
|
| 29 | + } |
|
| 30 | + $paramName = $param->item_option_name; |
|
| 31 | + echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
| 32 | + } |
|
| 33 | + ?> |
|
| 34 | 34 | </ul> |
| 35 | 35 | <div class="item-actions"> |
| 36 | 36 | <div class="item-price"> |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Pages |
|
| 4 | - * |
|
| 5 | - * @author Alexey Krupskiy <[email protected]> |
|
| 6 | - * @link http://inji.ru/ |
|
| 7 | - * @copyright 2015 Alexey Krupskiy |
|
| 8 | - * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 9 | - */ |
|
| 3 | + * Pages |
|
| 4 | + * |
|
| 5 | + * @author Alexey Krupskiy <[email protected]> |
|
| 6 | + * @link http://inji.ru/ |
|
| 7 | + * @copyright 2015 Alexey Krupskiy |
|
| 8 | + * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 9 | + */ |
|
| 10 | 10 | namespace Ui; |
| 11 | 11 | |
| 12 | 12 | class Pages extends \Object |