added helper for facades
This commit is contained in:
parent
fd7fdfe385
commit
20f2784099
|
|
@ -206,7 +206,7 @@
|
|||
<li>
|
||||
<a href="{{ route('admin.catalog.products.edit', $item->product_id) }}">
|
||||
<div class="product image">
|
||||
<?php $productBaseImage = ProductImage::getProductBaseImage($item->product); ?>
|
||||
<?php $productBaseImage = productimage()->getProductBaseImage($item->product); ?>
|
||||
|
||||
<img class="item-image" src="{{ $productBaseImage['small_image_url'] }}" />
|
||||
</div>
|
||||
|
|
@ -316,7 +316,7 @@
|
|||
<li>
|
||||
<a href="{{ route('admin.catalog.products.edit', $item->product_id) }}">
|
||||
<div class="image">
|
||||
<?php $productBaseImage = ProductImage::getProductBaseImage($item->product); ?>
|
||||
<?php $productBaseImage = productimage()->getProductBaseImage($item->product); ?>
|
||||
|
||||
<img class="item-image" src="{{ $productBaseImage['small_image_url'] }}" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
use Webkul\Product\ProductImage;
|
||||
use Webkul\Product\ProductVideo;
|
||||
|
||||
if (! function_exists('productimage')) {
|
||||
function productimage() {
|
||||
return app()->make(ProductImage::class);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('productvideo')) {
|
||||
function productvideo() {
|
||||
return app()->make(ProductVideo::class);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -23,6 +23,8 @@ class ProductServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
include __DIR__ . '/../Http/helpers.php';
|
||||
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->app->make(EloquentFactory::class)->load(__DIR__ . '/../Database/Factories');
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
@foreach ($reviews as $review)
|
||||
<div class="account-item-card mt-15 mb-15">
|
||||
<div class="media-info">
|
||||
<?php $image = ProductImage::getProductBaseImage($review->product); ?>
|
||||
<?php $image = productimage()->getProductBaseImage($review->product); ?>
|
||||
<a href="{{ route('shop.productOrCategory.index', $review->product->url_key) }}" title="{{ $review->product->name }}">
|
||||
<img class="media" src="{{ $image['small_image_url'] }}" alt=""/>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
@foreach ($reviews as $review)
|
||||
<div class="account-item-card mt-15 mb-15">
|
||||
<div class="media-info">
|
||||
<?php $image = ProductImage::getGalleryImages($review->product); ?>
|
||||
<?php $image = productimage()->getGalleryImages($review->product); ?>
|
||||
<img class="media" src="{{ $image[0]['small_image_url'] }}" alt="" />
|
||||
|
||||
<div class="info mt-20">
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div class="product-card">
|
||||
|
||||
<?php $productBaseImage = ProductImage::getProductBaseImage($product); ?>
|
||||
<?php $productBaseImage = productimage()->getProductBaseImage($product); ?>
|
||||
|
||||
@if ($product->new)
|
||||
<div class="sticker new">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="review-layouter mb-20">
|
||||
<div class="product-info">
|
||||
|
||||
<?php $productBaseImage = ProductImage::getProductBaseImage($product); ?>
|
||||
<?php $productBaseImage = productimage()->getProductBaseImage($product); ?>
|
||||
|
||||
<div class="product-image">
|
||||
<a href="{{ route('shop.productOrCategory.index', $product->url_key) }}" title="{{ $product->name }}">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="review-layouter">
|
||||
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
|
||||
|
||||
<?php $productBaseImage = ProductImage::getProductBaseImage($product); ?>
|
||||
<?php $productBaseImage = productimage()->getProductBaseImage($product); ?>
|
||||
|
||||
<div class="product-info">
|
||||
<div class="product-image">
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</script>
|
||||
@endif
|
||||
|
||||
<?php $productBaseImage = ProductImage::getProductBaseImage($product); ?>
|
||||
<?php $productBaseImage = productimage()->getProductBaseImage($product); ?>
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
@inject ('wishListHelper', 'Webkul\Customer\Helpers\Wishlist')
|
||||
|
||||
<?php
|
||||
$images = ProductImage::getGalleryImages($product);
|
||||
$images = productimage()->getGalleryImages($product);
|
||||
|
||||
$videos = ProductVideo::getVideos($product);
|
||||
$videos = productvideo()->getVideos($product);
|
||||
|
||||
$images = array_merge($images, $videos);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<div class="row col-12 fs16">
|
||||
<div class="col-12 row">
|
||||
@php
|
||||
$image = ProductImage::getProductBaseImage($review->product);
|
||||
$image = productimage()->getProductBaseImage($review->product);
|
||||
@endphp
|
||||
|
||||
<a
|
||||
|
|
|
|||
|
|
@ -20,15 +20,15 @@
|
|||
}
|
||||
|
||||
if (isset($item)) {
|
||||
$productBaseImage = ProductImage::getProductImage($item);
|
||||
$productBaseImage = productimage()->getProductImage($item);
|
||||
} else {
|
||||
$productBaseImage = ProductImage::getProductBaseImage($product);
|
||||
$productBaseImage = productimage()->getProductBaseImage($product);
|
||||
}
|
||||
|
||||
$totalReviews = $reviewHelper->getTotalReviews($product);
|
||||
$avgRatings = ceil($reviewHelper->getAverageRating($product));
|
||||
|
||||
$galleryImages = ProductImage::getGalleryImages($product);
|
||||
$galleryImages = productimage()->getGalleryImages($product);
|
||||
$priceHTML = view('shop::products.price', ['product' => $product])->render();
|
||||
|
||||
$product->__set('priceHTML', $priceHTML);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
$avgStarRating = round($avgRatings);
|
||||
|
||||
$productImages = [];
|
||||
$images = ProductImage::getGalleryImages($product);
|
||||
$images = productimage()->getGalleryImages($product);
|
||||
|
||||
foreach ($images as $key => $image) {
|
||||
array_push($productImages, $image['medium_image_url']);
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
</script>
|
||||
@endif
|
||||
|
||||
<?php $productBaseImage = ProductImage::getProductBaseImage($product); ?>
|
||||
<?php $productBaseImage = productimage()->getProductBaseImage($product); ?>
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
@php
|
||||
$config = $configurableOptionHelper->getConfigurationConfig($product);
|
||||
$galleryImages = ProductImage::getGalleryImages($product);
|
||||
$galleryImages = productimage()->getGalleryImages($product);
|
||||
@endphp
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.view.configurable-options.before', ['product' => $product]) !!}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
@inject ('wishListHelper', 'Webkul\Customer\Helpers\Wishlist')
|
||||
|
||||
@php
|
||||
$images = ProductImage::getGalleryImages($product);
|
||||
$videos = ProductVideo::getVideos($product);
|
||||
$images = productimage()->getGalleryImages($product);
|
||||
$videos = productvideo()->getVideos($product);
|
||||
|
||||
$videoData = $imageData = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
@php
|
||||
$productBaseImage = ProductImage::getProductBaseImage($product);
|
||||
$productBaseImage = productimage()->getProductBaseImage($product);
|
||||
@endphp
|
||||
|
||||
<div class="col-lg-3 col-md-12">
|
||||
|
|
|
|||
Loading…
Reference in New Issue