def order_proc():
    if request.method == 'POST':
        set_new_order({
            'product_id':
            _transaction_info['product_id'],
            'quantity':
            _transaction_info['quantity'],
            'customer_id':
            _transaction_info['customer_id'],
            'shipping_id':
            get_shipping_id(_transaction_info['customer_id']),
            'ship_name':
            request.form['name'],
            'ship_address':
            request.form['address'],
            'ship_city':
            request.form['city'],
            'ship_region':
            request.form['region'],
            'ship_postal_code':
            request.form['postal_code'],
            'ship_country':
            request.form['country'],
        })
        return render_template('order_list.html',
                               success=0,
                               order_records=get_orders())
    else:
        return render_template('order_list.html', order_records=get_orders())
Esempio n. 2
0
def orderhistory():
    orders = db.get_orders()
    order_list = []
    for item in orders:
        for order in item['details']:
            order_list.append(order)

    return render_template('orderhistory.html', order_list=order_list)
Esempio n. 3
0
def vieworders():
    orders = db.get_orders()
    order_list = []
    for prod in orders:
        for order in prod["details"]:
            order_list.append(order)

    return render_template('vieworders.html', order_list=order_list)
Esempio n. 4
0
def pastorders():
    orders = db.get_orders()
    order_list = []
    for item in orders:
        for order in item['details']:
            order_list.append(order)

    return render_template('pastorders.html',
                           page="Past Orders",
                           orders=order_list)
Esempio n. 5
0
def orderhistory():
    user_=session["user"]
    username=user_["username"]
    confirmed_order=om.check_user(username)

    if confirmed_order == True:
        past_orders=db.get_orders(username)

        return render_template('orderhistory.html', past_orders=past_orders)

    else:
        return render_template("noorders.html")
Esempio n. 6
0
def orders():
    user_ = session["user"]
    user_now = user_["username"]
    order_yes = om.check_user(user_now)

    if order_yes == True:
        order_list = db.get_orders(user_now)
        noorder = False

        return render_template('orders.html', order_list=order_list, noorder=noorder)
    else:
        noorder = True
        return render_template('orders.html', noorder=noorder)
Esempio n. 7
0
def orderhistory():
    user = session["user"]
    username = user["username"]
    
    arethereorders = om.check_user(username)
    
    if arethereorders == True:
        order_list = db.get_orders(username)
        return render_template('orderhistory.html', page="Orders",order_list=order_list)


    else:
        return render_template('orderhistory.html', page="Orders",order_list=order_list)
Esempio n. 8
0
def orders():
    code = request.args.get('code', '')
    product = db.get_orders(int(code))
    return render_template('orderhistory.html', code=code, order=order)