def merchant_order_finalized(request, venue_id):
    postdata = request.POST.copy()
    amount = cart.cart_subtotal(request, venue_id)
    results = {}
    cartnumber = merchant_response_3(request, venue_id)
    results = {'order_number': 0, 'message': u''}
    return cartnumber
def merchant_order_paid(request, venue_id):
    postdata = request.POST.copy()
    amount = cart.cart_subtotal(request, venue_id)
    results = {}
    ferror = create_order_cash(request, venue_id)
    results = {'order_number': 0, 'message': u''}
    return ferror
def process(request, venue_id):
    postdata = request.POST.copy()
    amount = cart.cart_subtotal(request, venue_id)
    results = {}
    prepare_order_cash(request, venue_id)
    results = {'order_number': 0, 'message': u''}
    return results
Exemplo n.º 4
0
def show_cart(request, venue_id, template_name="cart/show_cart.html"):
    """ view for each product page """
    #create the bound form
    postdata = request.POST.copy()
    form = ProductAddToCartForm(request, postdata)
    #check if posted data is valid
    if postdata['submit'] == 'Remove':
        cart.remove_from_cart(request, venue_id)
    if postdata['submit'] == 'Update':
        cart.update_cart(request, venue_id)
    if postdata['submit'] == 'Add':
        if form.is_valid():
            #add to cart and redirect to cart page
            cart.add_to_cart(request, venue_id)
        else:
            ferrors=form.errors
    # if test cookie worked, get rid of it
    if request.session.test_cookie_worked():
        request.session.delete_test_cookie()
    cart_items = cart.get_cart_items(request, venue_id)
    page_title = 'Shopping Cart'
    cart_subtotal = cart.cart_subtotal(request, venue_id)
    return render_to_response(template_name, locals(), context_instance=RequestContext(request))