Beispiel #1
0
def cart():
	if request.method=='POST':
		name=request.form['name']
		add_to_cart(name)
		return redirect(url_for('cart'))
	products=cart_info()
	return render_template('cart.html',products=products)
Beispiel #2
0
def cart():
    if request.method == 'POST':

        product_id = request.form['id']
        add_to_cart(product_id)
        return redirect(url_for('cart'))

    cart_list, total = cart_items(session['username'])
    return render_template('cart.html', cart=cart_list, total=total)
Beispiel #3
0
def add_cart():
    product_id = str(request.form['id'])
    add_to_cart(product_id, session['username'])
    return redirect(url_for('home'))