<reponame>itzomen/E-shop
from .models import Cart

def cart(request):
    try:
        if(request.user.id):
            cart = Cart.objects.get(user=request.user)
            return {'cart': cart}
        # handles anonymous user    
        return {}
    except:
        return {}
from .models import Cart

def cart(request):
    try:
        if(request.user.id):
            cart = Cart.objects.get(user=request.user)
            return {'cart': cart}
        # handles anonymous user    
        return {}
    except:
        return {}
# handles anonymous user