1 00:00:00,870 --> 00:00:01,530 Welcome back. 2 00:00:01,980 --> 00:00:10,140 Now, what we need to do is that we need to change the the the search criteria depending on the last 3 00:00:10,200 --> 00:00:12,210 thing that user choice. 4 00:00:12,570 --> 00:00:19,110 For example, if I say shoes a year and if I increase the the minimum price to 1000 and if I click on 5 00:00:19,110 --> 00:00:25,140 search, this is going to get me shoes that are worth $1,000 and less. 6 00:00:25,140 --> 00:00:30,780 But as soon as I get the result, the criteria will go back to the default. 7 00:00:30,780 --> 00:00:31,740 And we don't want that. 8 00:00:31,740 --> 00:00:39,660 We want to keep the criteria to the last to the last criteria that that the user choice. 9 00:00:40,380 --> 00:00:48,960 So to do this we here in the shop that we in the price we need to say in the value we need to say BHP 10 00:00:49,440 --> 00:00:53,910 and then we need to check the remember we need to check the price. 11 00:00:54,330 --> 00:00:55,770 This is this price. 12 00:00:56,730 --> 00:00:58,080 We need to check this price. 13 00:00:59,640 --> 00:01:00,990 So if we have a price. 14 00:01:02,540 --> 00:01:03,380 Laming, you say? 15 00:01:07,740 --> 00:01:08,130 If. 16 00:01:10,690 --> 00:01:11,110 If. 17 00:01:12,080 --> 00:01:13,440 Is sex. 18 00:01:16,310 --> 00:01:17,000 Rice. 19 00:01:18,140 --> 00:01:19,900 Then we need to display that price. 20 00:01:19,910 --> 00:01:21,230 We need to say echo price. 21 00:01:28,370 --> 00:01:30,710 Else here else. 22 00:01:32,540 --> 00:01:36,700 What we need to do is that we need to echo the default value. 23 00:01:36,710 --> 00:01:38,600 So the default value is 100. 24 00:01:39,170 --> 00:01:40,160 I'm going to say 100. 25 00:01:40,880 --> 00:01:42,080 That's it's pretty simple. 26 00:01:42,530 --> 00:01:49,790 Similarly, for the categories here, we need to say instead of saying, checked for all for all of 27 00:01:49,790 --> 00:01:58,490 these categories, we need to add up each because that's going to check the last criteria or the last 28 00:01:59,210 --> 00:02:00,740 category that the user chose. 29 00:02:00,740 --> 00:02:03,680 So here we need to say each be. 30 00:02:04,700 --> 00:02:05,330 And then. 31 00:02:07,260 --> 00:02:08,820 And then echo. 32 00:02:10,680 --> 00:02:11,340 And then. 33 00:02:13,050 --> 00:02:17,820 Before echoing you to say it if is said category. 34 00:02:19,940 --> 00:02:20,450 Then. 35 00:02:21,920 --> 00:02:24,440 Then I'm going to say eco. 36 00:02:24,470 --> 00:02:25,700 Gothic, eco. 37 00:02:27,110 --> 00:02:28,040 Eco checked. 38 00:02:28,910 --> 00:02:30,080 Check to check this. 39 00:02:31,390 --> 00:02:39,130 To take the this and then I'm going to repeat the same card to all other to all other categories. 40 00:02:39,130 --> 00:02:43,720 So here instead of check them and remove this check again, I'm going to add this good and I'm going 41 00:02:43,720 --> 00:02:47,590 to remove this checked and then I'm going to have this good and then we remove this checked of it. 42 00:02:47,590 --> 00:02:50,710 I'm going to add this good and this is not enough. 43 00:02:50,710 --> 00:02:54,910 We need also to say if category is set and. 44 00:02:55,980 --> 00:02:57,480 And here. 45 00:02:58,820 --> 00:03:03,060 And category is equal to the category here. 46 00:03:03,080 --> 00:03:04,690 So what is what's the category here? 47 00:03:04,700 --> 00:03:08,480 The category the category issues here with the smallest. 48 00:03:08,510 --> 00:03:09,950 Because in the database, it's small. 49 00:03:09,950 --> 00:03:11,250 It's not capital. 50 00:03:12,110 --> 00:03:14,540 Similarly, in the second one, we need to say and. 51 00:03:16,110 --> 00:03:20,880 Category is equal to courts. 52 00:03:24,690 --> 00:03:26,100 And then here we need to say. 53 00:03:26,100 --> 00:03:26,760 And. 54 00:03:29,640 --> 00:03:30,540 Category. 55 00:03:31,830 --> 00:03:32,940 Is equal to. 56 00:03:35,660 --> 00:03:36,320 Watches. 57 00:03:38,370 --> 00:03:42,180 And lastly, we carry the category here and. 58 00:03:46,110 --> 00:03:47,730 Category is equal to. 59 00:03:49,250 --> 00:03:50,030 Max. 60 00:03:51,970 --> 00:03:52,570 Let me save it. 61 00:03:52,570 --> 00:03:54,580 Let me now refresh and show you how awesome this is. 62 00:03:54,940 --> 00:04:03,010 Now, if I refresh and select, for example, shows and say five, 500 and click on search, the criteria 63 00:04:03,010 --> 00:04:09,280 will will remain the same will remain the the the last criteria that I selected. 64 00:04:09,280 --> 00:04:16,540 If I say here the last category and last price that I selected, if I say costs and 1000 and click on 65 00:04:16,540 --> 00:04:16,930 search. 66 00:04:17,560 --> 00:04:21,460 As you can see, it's going to get me costs that are $1,000 and less. 67 00:04:21,910 --> 00:04:27,130 And the the the values will remain the same here, which is amazing. 68 00:04:28,330 --> 00:04:35,680 Lastly, where they want it to to emphasize on is that either the search functionality you can modify 69 00:04:35,680 --> 00:04:38,800 this for example, you can add more categories if you want. 70 00:04:38,800 --> 00:04:43,300 If you have more categories in your database, you can add them, for example, if you have. 71 00:04:44,290 --> 00:04:53,800 Maybe you have other things such as, let's say you have shoes, cards, watches, bags, dyes, maybe 72 00:04:53,800 --> 00:04:57,670 ties, maybe glasses, sunglasses. 73 00:04:57,670 --> 00:04:58,480 You can add them. 74 00:04:58,840 --> 00:05:02,890 But you need you need to make sure that you have them in the database so that you get products. 75 00:05:02,890 --> 00:05:09,520 If you don't have them in the database and the user searches for for one of these categories and clicks 76 00:05:09,520 --> 00:05:13,750 on search you, they are not going to get anything because you don't have them in the database. 77 00:05:14,110 --> 00:05:19,030 So you need to add them to the database in order to make sure that the user will get them. 78 00:05:19,510 --> 00:05:25,000 So this search functionality is very, very important and it's going to help the user a lot because 79 00:05:25,000 --> 00:05:31,060 the user might not be interested in all products and they may be interested in one category.