text: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  from .models import *
  from django.shortcuts import render
  
  
  # Create your views here.
  def store(request):
      products = Product.objects.all()
      context = {'products': products}
      return render(request, 'store/Store.html', context)
  
  
  def cart(request):
      if request.user.is_authenticated:
          customer = request.user.customer
          order, created = Order.objects.get_or_create(customer=customer, complete=False)
          items = order.orderitem_set.all()
      else:
          # Create empty cart for now for non-logged in user
          items = []
          order = {'get_cart_total': 0, 'get_cart_items': 0}
  
      context = {'items': items, 'order': order}
      return render(request, 'store/Cart.html', context)
  
  
  def checkout(request):
      if request.user.is_authenticated:
          customer = request.user.customer
          order, created = Order.objects.get_or_create(customer=customer, complete=False)
          items = order.orderitem_set.all()
      else:
          # Create empty cart for now for non-logged in user
          items = []
          order = {'get_cart_total': 0, 'get_cart_items': 0}
  
      context = {'items': items, 'order': order}
      return render(request, 'store/Checkout.html', context)
  