def addToCart(request, product_id): try: request.session[int(product_id)] = 'item' return redirect('homepage-index') except: return render(request, '404.html', manufacturerContext(request))
def paymentInfo(request): context = manufacturerContext(request) context['users'] = User.objects.all() userId = request.user.id context['payment'] = PaymentInfo.objects.filter(accountId_id=userId) return render(request, 'myAccount/paymentInfo.html', context)
def productInfo(request, product_id): context = manufacturerContext(request) context['products'] = Product.objects.filter(id=product_id) context['images'] = ProductImage.objects.all() return render(request, 'productInfo/index.html', context)
def accountInfo(request): context = manufacturerContext(request) return render(request, 'myAccount/accountInfo.html', context)
def paymentMethod(request): context = manufacturerContext(request) context['cards'] = cardContext(request) return render(request, 'checkout/paymentMethod.html', context)
def getMethod(request): shippMethod = request.GET.get('methodship') context = manufacturerContext(request) context['shippingMethod'] = shippMethod return render(request, 'checkout/confirmation.html', context)
def shippingMethod(request): context = manufacturerContext(request) return render(request, 'checkout/shipping.html', context)
def showCart(request): context = manufacturerContext(request) context['images'] = ProductImage.objects.all() return render(request, 'checkout/showCart.html', context)