示例#1
0
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)
示例#3
0
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)
示例#5
0
def paymentMethod(request):
    context = manufacturerContext(request)
    context['cards'] = cardContext(request)
    return render(request, 'checkout/paymentMethod.html', context)
示例#6
0
def getMethod(request):
    shippMethod = request.GET.get('methodship')
    context = manufacturerContext(request)
    context['shippingMethod'] = shippMethod
    return render(request, 'checkout/confirmation.html', context)
示例#7
0
def shippingMethod(request):
    context = manufacturerContext(request)
    return render(request, 'checkout/shipping.html', context)
示例#8
0
def showCart(request):
    context = manufacturerContext(request)
    context['images'] = ProductImage.objects.all()
    return render(request, 'checkout/showCart.html', context)