Backward Compatibility Check
This commit is contained in:
parent
ed33906a4f
commit
b0d8c53d45
|
|
@ -64,14 +64,12 @@ class WishlistController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
$wishlistItems = $this->wishlistRepository->getCustomerWishlist();
|
||||
|
||||
if (! core()->getConfigData('general.content.shop.wishlist_option')) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return view($this->_config['view'], [
|
||||
'wishlistItems' => $wishlistItems,
|
||||
'items' => $this->wishlistRepository->getCustomerWishlist(),
|
||||
'isWishlistShared' => $this->currentCustomer->isWishlistShared(),
|
||||
'wishlistSharedLink' => $this->currentCustomer->getWishlistSharedLink()
|
||||
]);
|
||||
|
|
@ -169,10 +167,10 @@ class WishlistController extends Controller
|
|||
|
||||
$customer = $customerRepository->find(request()->get('id'));
|
||||
|
||||
$wishlistItems = $customer->wishlist_items()->where('shared', 1)->get();
|
||||
$items = $customer->wishlist_items()->where('shared', 1)->get();
|
||||
|
||||
if ($customer && $wishlistItems->isNotEmpty()) {
|
||||
return view($this->_config['view'], compact('customer', 'wishlistItems'));
|
||||
if ($customer && $items->isNotEmpty()) {
|
||||
return view($this->_config['view'], compact('customer', 'items'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<div class="account-item-card mt-15 mb-15">
|
||||
<div class="media-info">
|
||||
@php
|
||||
$image = $wishlistItem->product->getTypeInstance()->getBaseImage($wishlistItem);
|
||||
$image = $item->product->getTypeInstance()->getBaseImage($item);
|
||||
@endphp
|
||||
|
||||
<img class="media" src="{{ $image['small_image_url'] }}" alt="" />
|
||||
|
||||
<div class="info">
|
||||
<div class="product-name">
|
||||
{{ $wishlistItem->product->name }}
|
||||
{{ $item->product->name }}
|
||||
|
||||
@if (isset($wishlistItem->additional['attributes']))
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="item-options">
|
||||
@foreach ($wishlistItem->additional['attributes'] as $attribute)
|
||||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
</div>
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
|
||||
<span class="stars" style="display: inline">
|
||||
@for ($i = 1; $i <= $reviewHelper->getAverageRating($wishlistItem->product); $i++)
|
||||
@for ($i = 1; $i <= $reviewHelper->getAverageRating($item->product); $i++)
|
||||
<span class="icon star-icon"></span>
|
||||
@endfor
|
||||
</span>
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
|
||||
<div class="operations">
|
||||
<form id="wishlist-{{ $wishlistItem->id }}" action="{{ route('customer.wishlist.remove', $wishlistItem->id) }}" method="POST">
|
||||
<form id="wishlist-{{ $item->id }}" action="{{ route('customer.wishlist.remove', $item->id) }}" method="POST">
|
||||
@method('DELETE')
|
||||
|
||||
@csrf
|
||||
|
|
@ -38,12 +38,12 @@
|
|||
<a
|
||||
class="mb-50"
|
||||
href="javascript:void(0);"
|
||||
onclick="document.getElementById('wishlist-{{ $wishlistItem->id }}').submit();">
|
||||
onclick="document.getElementById('wishlist-{{ $item->id }}').submit();">
|
||||
<span class="icon trash-icon"></span>
|
||||
</a>
|
||||
@endauth
|
||||
|
||||
<a href="{{ route('customer.wishlist.move', $wishlistItem->id) }}" class="btn btn-primary btn-md">
|
||||
<a href="{{ route('customer.wishlist.move', $item->id) }}" class="btn btn-primary btn-md">
|
||||
{{ __('shop::app.customer.account.wishlist.move-to-cart') }}
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,10 +15,8 @@
|
|||
</div>
|
||||
|
||||
<div class="account-items-list">
|
||||
@foreach ($wishlistItems as $wishlistItem)
|
||||
@include('shop::customers.account.wishlist.wishlist-product', [
|
||||
'wishlistItem' => $wishlistItem
|
||||
])
|
||||
@foreach ($items as $item)
|
||||
@include('shop::customers.account.wishlist.wishlist-product', ['item' => $item])
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="account-head mb-15">
|
||||
<span class="account-heading">{{ __('shop::app.customer.account.wishlist.title') }}</span>
|
||||
|
||||
@if (count($wishlistItems))
|
||||
@if (count($items))
|
||||
<div class="account-action">
|
||||
<form id="remove-all-wishlist" action="{{ route('customer.wishlist.removeall') }}" method="POST">
|
||||
@method('DELETE')
|
||||
|
|
@ -36,18 +36,18 @@
|
|||
<div class="horizontal-rule"></div>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.before', ['wishlist' => $wishlistItems]) !!}
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.before', ['wishlist' => $items]) !!}
|
||||
|
||||
<div class="account-items-list">
|
||||
@if ($wishlistItems->count())
|
||||
@foreach ($wishlistItems as $wishlistItem)
|
||||
@if ($items->count())
|
||||
@foreach ($items as $item)
|
||||
@include('shop::customers.account.wishlist.wishlist-product', [
|
||||
'wishlistItem' => $wishlistItem
|
||||
'item' => $item
|
||||
])
|
||||
@endforeach
|
||||
|
||||
<div class="bottom-toolbar">
|
||||
{{ $wishlistItems->links() }}
|
||||
{{ $items->links() }}
|
||||
</div>
|
||||
@else
|
||||
<div class="empty">
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
</modal>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.after', ['wishlist' => $wishlistItems]) !!}
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.after', ['wishlist' => $items]) !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @var \Webkul\Product\Models\Product
|
||||
*/
|
||||
$product = $wishlistItem->product;
|
||||
$product = $item->product;
|
||||
@endphp
|
||||
|
||||
<div class="col-12 lg-card-container list-card product-card row">
|
||||
|
|
@ -42,14 +42,14 @@
|
|||
<span class="fs16">
|
||||
{{ __('shop::app.customer.account.wishlist.visibility') }} :
|
||||
|
||||
<span class="badge {{ $wishlistItem->shared ? 'badge-success' : 'badge-danger' }}">
|
||||
{{ $wishlistItem->shared ? __('shop::app.customer.account.wishlist.public') : __('shop::app.customer.account.wishlist.private') }}
|
||||
<span class="badge {{ $item->shared ? 'badge-success' : 'badge-danger' }}">
|
||||
{{ $item->shared ? __('shop::app.customer.account.wishlist.public') : __('shop::app.customer.account.wishlist.private') }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@include ('shop::products.add-to-cart', [
|
||||
@include('shop::products.add-to-cart', [
|
||||
'addWishlistClass' => 'pl10',
|
||||
'product' => $product,
|
||||
'addToCartBtnClass' => 'medium-padding',
|
||||
|
|
|
|||
|
|
@ -6,14 +6,6 @@
|
|||
|
||||
@section('content-wrapper')
|
||||
<div class="container p-5">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="wishlist-container">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="wishlist-container">
|
||||
|
|
@ -21,8 +13,8 @@
|
|||
{{ __('shop::app.customer.account.wishlist.customer-name', ['name' => $customer->name]) }}
|
||||
</h2>
|
||||
|
||||
@foreach ($wishlistItems as $wishlistItem)
|
||||
@include ('shop::customers.account.wishlist.wishlist-product', ['wishlistItem' => $wishlistItem])
|
||||
@foreach ($items as $item)
|
||||
@include('shop::customers.account.wishlist.wishlist-product', ['item' => $item])
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="account-head">
|
||||
<span class="account-heading">{{ __('shop::app.customer.account.wishlist.title') }}</span>
|
||||
|
||||
@if (count($wishlistItems))
|
||||
@if (count($items))
|
||||
<div class="account-action float-right">
|
||||
<form id="remove-all-wishlist" class="d-none" action="{{ route('customer.wishlist.removeall') }}" method="POST">
|
||||
@method('DELETE')
|
||||
|
|
@ -39,16 +39,16 @@
|
|||
@endif
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.before', ['wishlist' => $wishlistItems]) !!}
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.before', ['wishlist' => $items]) !!}
|
||||
|
||||
<div class="wishlist-container">
|
||||
@if ($wishlistItems->count())
|
||||
@foreach ($wishlistItems as $wishlistItem)
|
||||
@include ('shop::customers.account.wishlist.wishlist-product', ['wishlistItem' => $wishlistItem])
|
||||
@if ($items->count())
|
||||
@foreach ($items as $item)
|
||||
@include ('shop::customers.account.wishlist.wishlist-product', ['item' => $item])
|
||||
@endforeach
|
||||
|
||||
<div>
|
||||
{{ $wishlistItems->links() }}
|
||||
{{ $items->links() }}
|
||||
</div>
|
||||
@else
|
||||
<div class="empty">
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
</modal>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.after', ['wishlist' => $wishlistItems]) !!}
|
||||
{!! view_render_event('bagisto.shop.customers.account.wishlist.list.after', ['wishlist' => $items]) !!}
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
|
|
|||
Loading…
Reference in New Issue