{{-- Show all Vendor products page (when you click on a shop name in front/products/detail.blade.php) --}} {{-- This view is returned from vendorListing() method in Front/ProductsController.php --}} @extends('front.layout.layout') @section('content')

{{ $getVendorShop }}

{{-- Sorting Filter WITH AJAX. Check ajax_products_listing.blade.php --}}
@include('front.products.vendor_products_listing')
{{-- Laravel Pagination and showing it using Bootstrap Pagination --}} {{--
{{ $vendorProducts->links() }}
--}} {{-- Fixing the Laravel Pagination problem with the Sorting Filter where sorting gets messed up with pagination). The cause of the problem is that when you click on the pagination links like for example when you go to the second page, the URL query string parameters gets the pagination page number (e.g. 'page=2') but it loses the filter query string parameter (e.g. '&sort=desc'), so we have to always append the sorting filter query string parameter to the page number query string paramter --}} {{-- Appending Query String Values: https://laravel.com/docs/9.x/pagination#appending-query-string-values --}} @if (isset($_GET['sort'])) {{-- if there's a Sorting Filter used --}}
{{ $vendorProducts->appends(['sort' => $_GET['sort']])->links() }}
@else
{{ $vendorProducts->links() }}
@endif
 
@endsection