from .models import Categories, Cart, WishList
def getContext(request):
    categories = Categories.objects.all()
    cartItems = len(request.session.get('cart_products', {}))
    if request.user.is_authenticated:
        user= request.user
        cartItems = Cart.objects.filter(user=user).count()
        wishItems = WishList.objects.filter(user=user).count()
        return {"categories": categories, "cartItems":cartItems, "wishItems":wishItems}
    return locals()