Commit e261c53790fb184cdd5261d2826d300150df781a
1 parent
776dd7a1
500 images fix
Showing
4 changed files
with
38 additions
and
25 deletions
Show diff stats
frontend/controllers/CatalogController.php
| @@ -24,8 +24,8 @@ class CatalogController extends \yii\web\Controller | @@ -24,8 +24,8 @@ class CatalogController extends \yii\web\Controller | ||
| 24 | 24 | ||
| 25 | public function actionCategory() | 25 | public function actionCategory() |
| 26 | { | 26 | { |
| 27 | - | ||
| 28 | - | 27 | + |
| 28 | + | ||
| 29 | /** @var Category $category */ | 29 | /** @var Category $category */ |
| 30 | $category = Yii::$app->request->get('category'); | 30 | $category = Yii::$app->request->get('category'); |
| 31 | $filter = Yii::$app->request->get('filters', [ ]); | 31 | $filter = Yii::$app->request->get('filters', [ ]); |
| @@ -151,7 +151,7 @@ class CatalogController extends \yii\web\Controller | @@ -151,7 +151,7 @@ class CatalogController extends \yii\web\Controller | ||
| 151 | 151 | ||
| 152 | 152 | ||
| 153 | $priceLimits = $productModel->priceLimits($category, $params); | 153 | $priceLimits = $productModel->priceLimits($category, $params); |
| 154 | - | 154 | + |
| 155 | 155 | ||
| 156 | return $this->render('products', [ | 156 | return $this->render('products', [ |
| 157 | 'category' => $category, | 157 | 'category' => $category, |
frontend/views/catalog/_product_item.php
| @@ -38,12 +38,23 @@ use yii\helpers\Url; | @@ -38,12 +38,23 @@ use yii\helpers\Url; | ||
| 38 | ?> | 38 | ?> |
| 39 | 39 | ||
| 40 | </div> | 40 | </div> |
| 41 | - <?= \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list', [ | ||
| 42 | - 'alt' => $model->getFullName(), | ||
| 43 | - 'title' => $model->getFullName(), | ||
| 44 | - 'class' => 'selected', | ||
| 45 | - 'itemprop' => 'image' | ||
| 46 | - ]) ?> | 41 | + <?php |
| 42 | + try { | ||
| 43 | + echo \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list', [ | ||
| 44 | + 'alt' => $model->getFullName(), | ||
| 45 | + 'title' => $model->getFullName(), | ||
| 46 | + 'class' => 'selected', | ||
| 47 | + 'itemprop' => 'image' | ||
| 48 | + ]); | ||
| 49 | + } catch(Exception $exception) { | ||
| 50 | + echo \common\components\artboximage\ArtboxImageHelper::getImage('/storage/no_photo.png', 'list', [ | ||
| 51 | + 'alt' => $model->getFullName(), | ||
| 52 | + 'title' => $model->getFullName(), | ||
| 53 | + 'class' => 'selected', | ||
| 54 | + 'itemprop' => 'image' | ||
| 55 | + ]); | ||
| 56 | + } | ||
| 57 | + ?> | ||
| 47 | </a> | 58 | </a> |
| 48 | <div class="info_icons"> | 59 | <div class="info_icons"> |
| 49 | <?php if($model->variant->status != 1){?> | 60 | <?php if($model->variant->status != 1){?> |
frontend/views/catalog/product.php
| @@ -44,8 +44,8 @@ | @@ -44,8 +44,8 @@ | ||
| 44 | $this->params['remarketing']['type'] = 'offerdetail'; | 44 | $this->params['remarketing']['type'] = 'offerdetail'; |
| 45 | $this->params['remarketing']['id'] = $product->variant->product_variant_id; | 45 | $this->params['remarketing']['id'] = $product->variant->product_variant_id; |
| 46 | $this->params['remarketing']['price'] = $product->getPrice(); | 46 | $this->params['remarketing']['price'] = $product->getPrice(); |
| 47 | + | ||
| 47 | ?> | 48 | ?> |
| 48 | - | ||
| 49 | <div class="wrapper white item_container"> | 49 | <div class="wrapper white item_container"> |
| 50 | <div class="container"> | 50 | <div class="container"> |
| 51 | <div class="product_detail" itemscope itemtype="http://schema.org/Product"> | 51 | <div class="product_detail" itemscope itemtype="http://schema.org/Product"> |
| @@ -60,7 +60,6 @@ | @@ -60,7 +60,6 @@ | ||
| 60 | <div class="product_code">Код:<?= $product->variant->sku ?></div> | 60 | <div class="product_code">Код:<?= $product->variant->sku ?></div> |
| 61 | <div class="clearfix"></div> | 61 | <div class="clearfix"></div> |
| 62 | <!-- Image part --> | 62 | <!-- Image part --> |
| 63 | - | ||
| 64 | <div class="img_part"> | 63 | <div class="img_part"> |
| 65 | 64 | ||
| 66 | <div class="position"> | 65 | <div class="position"> |
| @@ -69,7 +68,6 @@ | @@ -69,7 +68,6 @@ | ||
| 69 | <div class="fotorama" data-allowfullscreen="true" data-nav="thumbs" | 68 | <div class="fotorama" data-allowfullscreen="true" data-nav="thumbs" |
| 70 | data-width="342" | 69 | data-width="342" |
| 71 | data-height="350"> | 70 | data-height="350"> |
| 72 | - | ||
| 73 | <?php foreach($product->images as $image) : ?> | 71 | <?php foreach($product->images as $image) : ?> |
| 74 | <a href="<?= $image->imageUrl ?>"> | 72 | <a href="<?= $image->imageUrl ?>"> |
| 75 | <?= ArtboxImageHelper::getImage($image->imageUrl, 'product_show') ?> | 73 | <?= ArtboxImageHelper::getImage($image->imageUrl, 'product_show') ?> |
| @@ -78,11 +76,21 @@ | @@ -78,11 +76,21 @@ | ||
| 78 | </div> | 76 | </div> |
| 79 | <?php else : ?> | 77 | <?php else : ?> |
| 80 | <a href="<?= $product->imageUrl ?>" data-lightbox="image-1" data-title="<?= $product->fullname;?>"> | 78 | <a href="<?= $product->imageUrl ?>" data-lightbox="image-1" data-title="<?= $product->fullname;?>"> |
| 81 | - <?= ArtboxImageHelper::getImage($product->imageUrl, 'product_show',[ | ||
| 82 | - 'alt'=>$product->fullname, | ||
| 83 | - 'title' => $product->fullname, | ||
| 84 | - 'itemprop' => 'image' | ||
| 85 | - ]) ?> | 79 | + <?php |
| 80 | + try { | ||
| 81 | + echo ArtboxImageHelper::getImage($product->imageUrl, 'product_show',[ | ||
| 82 | + 'alt'=>$product->fullname, | ||
| 83 | + 'title' => $product->fullname, | ||
| 84 | + 'itemprop' => 'image' | ||
| 85 | + ]); | ||
| 86 | + } catch(Exception $exception) { | ||
| 87 | + echo ArtboxImageHelper::getImage('/storage/no_photo.png', 'product_show',[ | ||
| 88 | + 'alt'=>$product->fullname, | ||
| 89 | + 'title' => $product->fullname, | ||
| 90 | + 'itemprop' => 'image' | ||
| 91 | + ]); | ||
| 92 | + } | ||
| 93 | + ?> | ||
| 86 | </a> | 94 | </a> |
| 87 | 95 | ||
| 88 | <?php endif ?> | 96 | <?php endif ?> |
frontend/views/catalog/products.php
| @@ -60,7 +60,6 @@ | @@ -60,7 +60,6 @@ | ||
| 60 | 'priceLimits' => $priceLimits, | 60 | 'priceLimits' => $priceLimits, |
| 61 | //'filterBrands' => $filterBrands | 61 | //'filterBrands' => $filterBrands |
| 62 | ])?> | 62 | ])?> |
| 63 | - | ||
| 64 | <div class="clearfix"></div> | 63 | <div class="clearfix"></div> |
| 65 | 64 | ||
| 66 | 65 | ||
| @@ -102,6 +101,7 @@ | @@ -102,6 +101,7 @@ | ||
| 102 | ]); | 101 | ]); |
| 103 | ?> | 102 | ?> |
| 104 | </div> | 103 | </div> |
| 104 | + | ||
| 105 | <div class="clearfix"></div> | 105 | <div class="clearfix"></div> |
| 106 | </div> | 106 | </div> |
| 107 | 107 | ||
| @@ -117,14 +117,12 @@ | @@ -117,14 +117,12 @@ | ||
| 117 | 117 | ||
| 118 | 118 | ||
| 119 | <div class="catalog_product_list view_table"> | 119 | <div class="catalog_product_list view_table"> |
| 120 | - | ||
| 121 | - | ||
| 122 | <?= ListView::widget([ | 120 | <?= ListView::widget([ |
| 123 | 'dataProvider' => $productProvider, | 121 | 'dataProvider' => $productProvider, |
| 124 | 'itemView' => function ($model, $key, $index, $widget) use($category) { | 122 | 'itemView' => function ($model, $key, $index, $widget) use($category) { |
| 125 | return $this->render('_product_item',[ | 123 | return $this->render('_product_item',[ |
| 126 | 'model' => $model, | 124 | 'model' => $model, |
| 127 | - 'category' => $category | 125 | + 'category' => $category, |
| 128 | ]); | 126 | ]); |
| 129 | }, | 127 | }, |
| 130 | 'layout' => "{items}<div class=\"clearfix\"></div>{pager}", | 128 | 'layout' => "{items}<div class=\"clearfix\"></div>{pager}", |
| @@ -132,9 +130,6 @@ | @@ -132,9 +130,6 @@ | ||
| 132 | 130 | ||
| 133 | ?> | 131 | ?> |
| 134 | 132 | ||
| 135 | - | ||
| 136 | - | ||
| 137 | - | ||
| 138 | <div class="clearfix"></div> | 133 | <div class="clearfix"></div> |
| 139 | </div> | 134 | </div> |
| 140 | 135 | ||
| @@ -142,4 +137,3 @@ | @@ -142,4 +137,3 @@ | ||
| 142 | </div> | 137 | </div> |
| 143 | <?php Pjax::end()?> | 138 | <?php Pjax::end()?> |
| 144 | 139 | ||
| 145 | - |