This commit is contained in:
rahul shukla 2019-10-07 16:36:16 +05:30
parent 2020006d47
commit 878c0eb8e5
6 changed files with 47 additions and 30 deletions

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

@ -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') }}