diff --git a/backend/controllers/BrandController.php b/backend/controllers/BrandController.php index 1831b62..ca9d797 100755 --- a/backend/controllers/BrandController.php +++ b/backend/controllers/BrandController.php @@ -85,7 +85,7 @@ class BrandController extends Controller $model->image = $image->name; } if ($model->save() && $image) { - $image->saveAs(Yii::getAlias('@frontend/web/images/brand/' . $image->name)); + $image->saveAs(Yii::getAlias('@storage/brand/' . $image->name)); } return is_null(Yii::$app->request->post('create_and_new')) ? $this->redirect(['view', 'id' => $model->brand_id]) : $this->redirect(array_merge(['create'], Yii::$app->request->queryParams)); @@ -110,7 +110,7 @@ class BrandController extends Controller $model->image = $image->name; } if ($model->save() && $image) { - $image->saveAs(Yii::getAlias('@frontend/web/images/brand/' . $image->name)); + $image->saveAs(Yii::getAlias('@storage/brand/' . $image->name)); } return $this->redirect(['view', 'id' => $model->brand_id]); diff --git a/backend/controllers/CategoryController.php b/backend/controllers/CategoryController.php index 88a6dbd..c6a1c87 100755 --- a/backend/controllers/CategoryController.php +++ b/backend/controllers/CategoryController.php @@ -88,7 +88,7 @@ class CategoryController extends Controller $model->image = $image->name; } if ($model->save() && $image) { - $image->saveAs(Yii::getAlias('@frontend/web/images/category/' . $image->name)); + $image->saveAs(Yii::getAlias('@storage/category/' . $image->name)); } return is_null(Yii::$app->request->post('create_and_new')) ? $this->redirect(['view', 'id' => $model->category_id]) : $this->redirect(array_merge(['create'], Yii::$app->request->queryParams)); @@ -118,7 +118,7 @@ class CategoryController extends Controller $model->image = $image->name; } if ($model->save() && $image) { - $image->saveAs(Yii::getAlias('@frontend/web/images/category/' . $image->name)); + $image->saveAs(Yii::getAlias('@storage/category/' . $image->name)); } return $this->redirect(['view', 'id' => $model->category_id]); diff --git a/common/modules/product/models/Category.php b/common/modules/product/models/Category.php index 9c63b0b..e019e5d 100755 --- a/common/modules/product/models/Category.php +++ b/common/modules/product/models/Category.php @@ -195,7 +195,7 @@ class Category extends \yii\db\ActiveRecord public function getImageUrl() { // return a default image placeholder if your source image is not found - return isset($this->image) ? '/images/category/'. $this->image : '/images/no_photo.png'; + return isset($this->image) ? '/storage/category/'. $this->image : '/storage/no_photo.png'; } diff --git a/common/modules/product/models/Product.php b/common/modules/product/models/Product.php index 56c1019..63a1a23 100755 --- a/common/modules/product/models/Product.php +++ b/common/modules/product/models/Product.php @@ -242,12 +242,12 @@ class Product extends \yii\db\ActiveRecord foreach ($this->imagesUpload as $image) { $imageName = $image->baseName .'.'. $image->extension; $i = 0; - while(file_exists(Yii::getAlias('@frontend/web/images/products/' . $imageName))) { + while(file_exists(Yii::getAlias('@storage/products/' . $imageName))) { $i++; $imageName = $image->baseName .'_'. $i .'.'. $image->extension; } - $image->saveAs(Yii::getAlias('@frontend/web/images/products/' .$imageName)); + $image->saveAs(Yii::getAlias('@storage/products/' .$imageName)); $images[] = $imageName; } return $images; @@ -259,7 +259,7 @@ class Product extends \yii\db\ActiveRecord public function getImageUrl() { $image = empty($this->variant) ? null : $this->variant->image; - return !empty($image) ? $image->imageUrl : '/images/no_photo.png'; + return !empty($image) ? $image->imageUrl : '/storage/no_photo.png'; } public function getImagesHTML() { diff --git a/common/modules/product/models/ProductImage.php b/common/modules/product/models/ProductImage.php index 52d8fdd..e6daf78 100755 --- a/common/modules/product/models/ProductImage.php +++ b/common/modules/product/models/ProductImage.php @@ -97,7 +97,7 @@ class ProductImage extends \yii\db\ActiveRecord */ public function getImageFile() { - return isset($this->image) ? '/images/products/' . $this->image : null; + return isset($this->image) ? '/storage/products/' . $this->image : null; } /** @@ -107,7 +107,7 @@ class ProductImage extends \yii\db\ActiveRecord public function getImageUrl() { // return a default image placeholder if your source image is not found - return isset($this->image) ? '/images/products/'. $this->image : '/images/no_photo.png'; + return isset($this->image) ? '/storage/products/'. $this->image : '/storage/no_photo.png'; } /** diff --git a/common/modules/product/models/ProductVariant.php b/common/modules/product/models/ProductVariant.php index 7a49e4c..087f592 100755 --- a/common/modules/product/models/ProductVariant.php +++ b/common/modules/product/models/ProductVariant.php @@ -97,7 +97,7 @@ class ProductVariant extends \yii\db\ActiveRecord public function getImageUrl() { // return a default image placeholder if your source image is not found - return !empty($this->image) ? $this->image->imageUrl : '/images/no_photo.png'; + return !empty($this->image) ? $this->image->imageUrl : '/storage/no_photo.png'; } /** diff --git a/common/modules/product/widgets/views/product_smart.php b/common/modules/product/widgets/views/product_smart.php index b47be81..d583dcc 100644 --- a/common/modules/product/widgets/views/product_smart.php +++ b/common/modules/product/widgets/views/product_smart.php @@ -55,7 +55,7 @@ use yii\helpers\Url; 'catalog/product', 'product' => $product, '#' => 'm' . $variant->product_variant_id]) ?>"> - image) && !empty($variant->image->imageUrl) ? $variant->image->imageUrl : '/images/no_photo.png'), 'product_variant')?> + imageUrl, 'product_variant')?> diff --git a/common/modules/product/widgets/views/products_block.php b/common/modules/product/widgets/views/products_block.php index 7d239a7..85a6e91 100644 --- a/common/modules/product/widgets/views/products_block.php +++ b/common/modules/product/widgets/views/products_block.php @@ -17,11 +17,7 @@ use yii\web\View;
- image)) :?> - - - image->imageUrl, 'product_list')?> - + imageUrl, 'product_list')?>
name?>
diff --git a/common/modules/product/widgets/views/submenu.php b/common/modules/product/widgets/views/submenu.php index ccb8932..2fe6ac8 100755 --- a/common/modules/product/widgets/views/submenu.php +++ b/common/modules/product/widgets/views/submenu.php @@ -9,11 +9,7 @@
- image)) :?> - - - imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item->imageUrl, 'mainmenu') : ''?> - + imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item->imageUrl, 'mainmenu') : ''?>
categoryName->value?>
@@ -31,11 +27,7 @@
- image)) :?> - - - imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item['item']->imageUrl, 'mainmenu') : ''?> - + imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item['item']->imageUrl, 'mainmenu') : ''?>
categoryName->value?>
diff --git a/common/widgets/views/basket_modal.php b/common/widgets/views/basket_modal.php index 48ff939..db3d0e7 100755 --- a/common/widgets/views/basket_modal.php +++ b/common/widgets/views/basket_modal.php @@ -17,7 +17,7 @@ use yii\helpers\Html;
product->image)) :?> - + <?= $item['item']->product->image->alt ? $item['item']->product->image->alt : $item['item']->product->name?> diff --git a/frontend/views/catalog/product.php b/frontend/views/catalog/product.php index 87cab7c..2f5bca7 100755 --- a/frontend/views/catalog/product.php +++ b/frontend/views/catalog/product.php @@ -21,16 +21,18 @@ $this->params['breadcrumbs'][] = $product->name .' #'. $product->variant->sku;
-
images)) :?> +
images as $image) :?> imageUrl, 'product_trumb')?> -
+ + imageUrl, 'product')?> +
-->
+

С этим товаром покупают

@@ -130,7 +133,7 @@ $this->params['breadcrumbs'][] = $product->name .' #'. $product->variant->sku;
АКЦИЯ
Toп
-
+
Штукатурка гипсовая Кнауф Ротбанд 30 кг белая
Бренд: Knauf
Штукатурки
@@ -143,7 +146,7 @@ $this->params['breadcrumbs'][] = $product->name .' #'. $product->variant->sku;
АКЦИЯ
Toп
-
+
Штукатурка гипсовая Кнауф Ротбанд 30 кг белая
Бренд: Knauf
Штукатурки
@@ -156,7 +159,7 @@ $this->params['breadcrumbs'][] = $product->name .' #'. $product->variant->sku;
АКЦИЯ
Toп
-
+
Штукатурка гипсовая Кнауф Ротбанд 30 кг белая
Бренд: Knauf
Штукатурки
@@ -169,7 +172,7 @@ $this->params['breadcrumbs'][] = $product->name .' #'. $product->variant->sku;
АКЦИЯ
Toп
-
+
Штукатурка гипсовая Кнауф Ротбанд 30 кг белая
Бренд: Knauf
Штукатурки
@@ -180,6 +183,7 @@ $this->params['breadcrumbs'][] = $product->name .' #'. $product->variant->sku;
+ */?>
    diff --git a/frontend/views/catalog/product_item.php b/frontend/views/catalog/product_item.php index 64da391..6ba5b38 100755 --- a/frontend/views/catalog/product_item.php +++ b/frontend/views/catalog/product_item.php @@ -7,11 +7,7 @@ use common\components\artboximage\ArtboxImageHelper;
    Toп
    -->
    - image)) :?> - - - image->imageUrl, 'product_list')?> - + imageUrl, 'product_list')?>
    name?>
    brand)) :?> diff --git a/frontend/views/catalog/product_smart.php b/frontend/views/catalog/product_smart.php index acf96b9..6b9ebc9 100755 --- a/frontend/views/catalog/product_smart.php +++ b/frontend/views/catalog/product_smart.php @@ -7,11 +7,7 @@ use common\components\artboximage\ArtboxImageHelper;
    Toп
    -->
    - image)) :?> - - - image->imageUrl, 'product_list')?> - + imageUrl, 'product_list')?>
    name?>
    brand) :?> diff --git a/frontend/views/orders/basket-step-02.php b/frontend/views/orders/basket-step-02.php index beaf0b4..c9f17ae 100755 --- a/frontend/views/orders/basket-step-02.php +++ b/frontend/views/orders/basket-step-02.php @@ -25,7 +25,7 @@ $this->params['breadcrumbs'][] = $this->title;
    product->image)) :?> - + <?= $item['item']->product->image->alt ? $item['item']->product->image->alt : $item['item']->product->name?> -- libgit2 0.21.4