Merge pull request #1549 from rahulshukla-webkul/development

Issue #1548
This commit is contained in:
Jitendra Singh 2019-10-09 16:21:34 +05:30 committed by GitHub
commit fc920e14c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 51 additions and 35 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=0afa8deaa3ea01b81abf",
"/css/admin.css": "/css/admin.css?id=e9178754dd7096a8f7a0"
"/js/admin.js": "/js/admin.js?id=d27aed3da0c62eb237be",
"/css/admin.css": "/css/admin.css?id=15ccc108fec211bb2af2"
}

View File

@ -6,7 +6,6 @@
// buttons
.btn.btn-primary{
background: $btn-primary-bg;
color: $btn-primary-bg !important;
}
.fixed-action {

View File

@ -166,7 +166,7 @@ class CustomerController extends Controller
*/
public function reviews()
{
$reviews = auth()->guard('customer')->user()->all_reviews;
$reviews = $this->productReview->getCustomerReview();
return view($this->_config['view'], compact('reviews'));
}

View File

@ -48,10 +48,7 @@ class WishlistController extends Controller
* Displays the listing resources if the customer having items in wishlist.
*/
public function index() {
$wishlistItems = $this->wishlist->findWhere([
'channel_id' => core()->getCurrentChannel()->id,
'customer_id' => auth()->guard('customer')->user()->id]
);
$wishlistItems = $this->wishlist->getCustomerWhishlist();
return view($this->_config['view'])->with('items', $wishlistItems);
}

View File

@ -61,4 +61,17 @@ class WishlistRepository extends Repository
public function getItemsWithProducts($id) {
return $this->model->find($id)->item_wishlist;
}
/**
* get customer wishlist Items.
*
* @return mixed
*/
public function getCustomerWhishlist() {
return $this->model->where([
'channel_id' => core()->getCurrentChannel()->id,
'customer_id' => auth()->guard('customer')->user()->id
])->paginate(5);
}
}

View File

@ -55,7 +55,7 @@ class ProductReviewRepository extends Repository
{
$customerId = auth()->guard('customer')->user()->id;
$reviews = $this->model->where(['customer_id'=> $customerId])->with('product')->get();
$reviews = $this->model->where(['customer_id'=> $customerId])->with('product')->paginate(5);
return $reviews;
}

View File

@ -65,6 +65,10 @@
</div>
<div class="horizontal-rule mb-10 mt-10"></div>
@endforeach
<div class="bottom-toolbar">
{{ $reviews->links() }}
</div>
@else
<div class="empty mt-15">
{{ __('customer::app.reviews.empty') }}

View File

@ -25,39 +25,42 @@
<div class="account-items-list">
@if ($items->count())
@foreach ($items as $item)
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
@php
$image = $productImageHelper->getProductBaseImage($item->product);
@endphp
@foreach ($items as $item)
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
@php
$image = $productImageHelper->getProductBaseImage($item->product);
@endphp
<img class="media" src="{{ $image['small_image_url'] }}" />
<img class="media" src="{{ $image['small_image_url'] }}" />
<div class="info">
<div class="product-name">
{{$item->product->name}}
<div class="info">
<div class="product-name">
{{$item->product->name}}
</div>
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
<span class="stars" style="display: inline">
@for($i=1;$i<=$reviewHelper->getAverageRating($item->product);$i++)
<span class="icon star-icon"></span>
@endfor
</span>
</div>
</div>
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
<div class="operations">
<a class="mb-50" href="{{ route('customer.wishlist.remove', $item->id) }}"><span class="icon trash-icon"></span></a>
<span class="stars" style="display: inline">
@for($i=1;$i<=$reviewHelper->getAverageRating($item->product);$i++)
<span class="icon star-icon"></span>
@endfor
</span>
<a href="{{ route('customer.wishlist.move', $item->id) }}" class="btn btn-primary btn-md">{{ __('shop::app.wishlist.move-to-cart') }}</a>
</div>
</div>
<div class="horizontal-rule mb-10 mt-10"></div>
@endforeach
<div class="operations">
<a class="mb-50" href="{{ route('customer.wishlist.remove', $item->id) }}"><span class="icon trash-icon"></span></a>
<a href="{{ route('customer.wishlist.move', $item->id) }}" class="btn btn-primary btn-md">{{ __('shop::app.wishlist.move-to-cart') }}</a>
</div>
<div class="bottom-toolbar">
{{ $items->links() }}
</div>
<div class="horizontal-rule mb-10 mt-10"></div>
@endforeach
@else
<div class="empty">
{{ __('customer::app.wishlist.empty') }}