How to show cart on every page
Suppose you would like to show cart contents on every page of your store. This means that main template should be aware about current cart object. To do this, at first enable current_cart contect processor, but editing your djw/custom/project_settings.py:
TEMPLATE_CONTEXT_PROCESSORS += ( 'djw.core.utils.context_processors.current_cart', )
Then, in your template you can access your cart via current_cart object and display cart contents:
<form method="get" action="{% url cart-index %}">
<div class="cart">Shopping Cart</div>
<ul>
{% for item in current_cart.getItems %}
<li>{{ item.product.name }}</li>
{% endfor %}
</ul>
</form>
