Removed Some Code! - Reference:
This commit is contained in:
parent
f9b51f8367
commit
3df10d8c74
|
|
@ -110,16 +110,6 @@ class ConfigurationController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($params['product_view_images'])) {
|
||||
foreach ($params['product_view_images'] as $index => $productViewImage) {
|
||||
if ($productViewImage !== "") {
|
||||
$params['product_view_images'][$index] = $this->uploadImage($productViewImage, $index);
|
||||
}
|
||||
}
|
||||
|
||||
$params['product_view_images'] = json_encode($params['product_view_images']);
|
||||
}
|
||||
|
||||
$params['advertisement'] = json_encode($params['advertisement']);
|
||||
$params['home_page_content'] = str_replace('=>', '=>', $params['home_page_content']);
|
||||
|
||||
|
|
@ -209,33 +199,6 @@ class ConfigurationController extends Controller
|
|||
return $saveImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload image.
|
||||
*
|
||||
* @param array $image
|
||||
* @param int $index
|
||||
* @return mixed
|
||||
*/
|
||||
public function uploadImage($image, $index)
|
||||
{
|
||||
$type = 'product_view_images';
|
||||
|
||||
$file = $type . '.' . $index;
|
||||
$dir = "velocity/$type";
|
||||
|
||||
if (request()->hasFile($file)) {
|
||||
Storage::delete($dir . $file);
|
||||
|
||||
$imagePath = request()->file($file)->store($dir);
|
||||
|
||||
if ($image->getMimeType() === 'image/svg') {
|
||||
$this->sanitizeSVG($imagePath);
|
||||
}
|
||||
}
|
||||
|
||||
return $imagePath ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage add images.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -205,19 +205,6 @@
|
|||
@include('shop::products.view.related-products')
|
||||
@include('shop::products.view.up-sells')
|
||||
</div>
|
||||
|
||||
<div class="store-meta-images col-3">
|
||||
@if(
|
||||
isset($velocityMetaData['product_view_images'])
|
||||
&& $velocityMetaData['product_view_images']
|
||||
)
|
||||
@foreach (json_decode($velocityMetaData['product_view_images'], true) as $image)
|
||||
@if ($image && $image !== '')
|
||||
<img src="{{ url()->to('/') }}/storage/{{ $image }}" alt=""/>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
{!! view_render_event('bagisto.shop.products.view.after', ['product' => $product]) !!}
|
||||
@endsection
|
||||
|
|
|
|||
Loading…
Reference in New Issue