#68 Make E-com in Laravel 7 | Make Listing Page (VI) | Sorting Filters | Sort by Price/Name/New

Stack Developers
Stack Developers
2.5 هزار بار بازدید - 4 سال پیش - In Part-68 of Advance E-com
In Part-68 of Advance E-com Series in Laravel 7, we will continue working on the listing page where we will show all the products of some particular category. In this video, we will work on sorting filters for our listing page like displaying products in ascending/descending order in term of product names and prices. 1) Update listing.blade.php file :- First of all, we will update "Sort By" select box with below options :- Latest Product Product name A - Z Product name Z - A Lowest Price first Highest Price first We will also update sort by form id and name with sortProducts. 2) Create front_script.js :- Now we will create front_script.js file for front like we have created admin_script.js for admin. In front_script.js file, we will add jquery to submit Sort by form with change event that works every time when sort option selected. 3) Update front_layout.blade.php file :- Now include newly created front_script.js file at front_layout.blade.php 4) Update listing function :- Now we need to update listing function to update query with sort option if selected. 5) Update listing.blade.php file :- Finally, we require to update listing file to appends option of paging that append the pagination links with query string like sort. Also, update sortProducts form to show the selected sort option in Sort By select drop down. Thanks for watching :) Join this channel to get complete code / full support :
4 سال پیش در تاریخ 1399/06/23 منتشر شده است.
2,574 بـار بازدید شده
... بیشتر