The video for this lesson is currently being updated, please read the transcript instead.

Cart total and persisting state

The final feature to implement for the cart is the cart total. This value is used in the Cart Summary card over here on the right. As you can see it's currently fixed at zero.

We can implement this feature in a very similar way to how we implemented the cart count, by creating a custom getter for our item model.

Once again I've created a constant for this getter already, so let's import the CART_TOTAL constant here in our item module file.

To view the complete lesson you'll need to login or join this course.


Click to load comments...