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]) ?>">
- = \common\components\artboximage\ArtboxImageHelper::getImage((!empty($variant->image) && !empty($variant->image->imageUrl) ? $variant->image->imageUrl : '/images/no_photo.png'), 'product_variant')?>
+ = \common\components\artboximage\ArtboxImageHelper::getImage($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;
-
- = ArtboxImageHelper::getImage($product->image->imageUrl, 'product_list')?>
-
+ = \common\components\artboximage\ArtboxImageHelper::getImage($product->imageUrl, 'product_list')?>