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.
Click to load comments...