Issue #1463
This commit is contained in:
parent
2020006d47
commit
878c0eb8e5
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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') }}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@
|
|||
<div class="horizontal-rule mb-10 mt-10"></div>
|
||||
@endforeach
|
||||
|
||||
<div class="bottom-toolbar">
|
||||
{{ $items->links() }}
|
||||
</div>
|
||||
@else
|
||||
<div class="empty">
|
||||
{{ __('customer::app.wishlist.empty') }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue