def get(self, request): customer = Customer.get_customer_by_email(request.user.email) cart_size = Cart.get_all_products_by_user(request.user.id) return render(request, 'profile.html', { 'customer': customer, 'cart_size': len(cart_size) })
def get(self, request): product_id = request.GET['product_id'] product = Product.get_product_by_id(product_id) cart_size = Cart.get_all_products_by_user(request.user.id) return render(request, 'product_details.html', { 'product': product, 'cart_size': len(cart_size) })