WEBVTT 00:01.270 --> 00:03.460 So this time around, I have a bit of a challenge for you. 00:03.520 --> 00:07.660 It's not terribly difficult, but will give you a bit more experience doing the sorts of things we've 00:07.660 --> 00:08.910 been covering in this section. 00:09.250 --> 00:11.170 So I'm logged into my application right now. 00:11.200 --> 00:16.150 And if I go to the admin menu and choose all sales, it lists all of my sales. 00:16.150 --> 00:20.170 And I just have one in here because I was playing with the database between the last lecture and this 00:20.170 --> 00:20.410 one. 00:21.430 --> 00:27.880 But if you on your application go to all subscriptions, it just displays a kind of placeholder template 00:27.880 --> 00:30.420 that has nothing more than a title and a horizontal rule. 00:30.790 --> 00:36.790 But when I go there, I get a list of all subscriptions and I want you to write the necessary code to 00:36.790 --> 00:38.000 do this sort of thing. 00:38.500 --> 00:43.060 Now, obviously, for both sales and subscriptions, this link doesn't work yet because we haven't covered 00:43.060 --> 00:43.300 that. 00:43.300 --> 00:44.450 But we'll get to that shortly. 00:44.920 --> 00:49.750 In the meantime, I'd like you to write the necessary code to list all subscriptions. 00:50.110 --> 00:54.760 Obviously, you'll have to sell a subscription first to have something to display here. 00:55.090 --> 00:57.360 But this shouldn't be terribly difficult for you. 00:57.940 --> 01:02.650 Obviously, you're going to have to modify the template for all subscriptions to do pretty much the 01:02.650 --> 01:04.420 same thing you do in all sales. 01:04.690 --> 01:10.600 And you'll have to create a new route on the API backend that will return all sales as JSON. 01:11.020 --> 01:16.960 And you'll either have to create a new database function or modify the existing one to return all subscriptions 01:16.960 --> 01:19.390 instead of all sales or all orders. 01:19.750 --> 01:24.580 And if you recall, the way we're determining whether or not something is a subscription is if that 01:24.580 --> 01:30.400 field is underscore recurring is set to one in the database, in the widgets table. 01:30.430 --> 01:31.990 If it's one, it's a plan. 01:32.230 --> 01:33.910 If it's zero, it's a product. 01:34.600 --> 01:34.930 All right. 01:34.930 --> 01:35.800 Give it a whirl. 01:35.800 --> 01:38.690 And in the next lecture, I'll show you how I accomplish that. 01:39.190 --> 01:39.640 Good luck.