fixed product image

This commit is contained in:
Edward Yang 2022-07-26 15:50:00 +08:00
parent b8c21f66e5
commit 6ce395f544
2 changed files with 4 additions and 4 deletions

View File

@ -22,10 +22,10 @@ class ImageService
const PLACEHOLDER_IMAGE = 'catalog/placeholder.png';
/**
* @param string $image
* @param $image
* @throws \Exception
*/
public function __construct(string $image)
public function __construct($image)
{
$this->image = $image ?: self::PLACEHOLDER_IMAGE;
$imagePath = public_path($this->image);

View File

@ -1,8 +1,8 @@
<div class="product-wrap">
<div class="image"><a href="{{ $product->url }}"><img src="{{ $product->image }}" class="img-fluid"></a></div>
<div class="image"><a href="{{ $product->url }}"><img src="{{ image_resize($product->image, 300, 300) }}" class="img-fluid"></a></div>
<div class="product-name">{{ $product->description->name }}</div>
<div class="product-price">
<span class="price-new">{{ $product->master_sku->price }}</span>
<span class="price-lod">{{ $product->master_sku->origin_price }}</span>
</div>
</div>
</div>