In the "Setup" section above, we saw that we need to call Liquid tag.
This is because it's possible (and quite common) to have multiple items in the cart with the same variant ID but with different properties.
However, it was no longer updating the latest cart total. If someone out there can provide any insight or a workaround to this code, please help!! Without seeing your theme in action the forum members will be limited on what help that can give.
I can tell you that the code you had was closer to a solution than what you changed it to.
A full list of these options is available in the Option Reference.
If we want to inspect the state of our cart at any time, we can access the in the cart.