def order_create(): qwe = request.get_data() qwe = json.loads(qwe) order_key = create_order(u''+qwe['name'], u''+qwe['street']+u' д.'+qwe['house']+u' кв.'+qwe['apartment'], qwe['email'], qwe['phone'], products_in_bag) result = {} if order_key == '': result['status'] = 'false' else: result['status'] = 'true' result['key'] = order_key del products_in_bag[:] return json.dumps(result)
def order_create(): name = u''+request.form['firstname']+u' '+request.form['lastname'] email = request.form['email'] phone = request.form['telephone'] address = u'Вологда, '+request.form['street']+u', д.'+request.form['house']+u', кв.'+request.form['apartment'] products = [] for product in session['bag']: for i in range(int(product['qty'])): products.append(int(product['pid'])) order_info = create_order(name, address, email, phone, products) result = {} if order_info == '': result['status'] = 'false' else: result['status'] = 'true' session['order_id'] = order_info clean_cart() return json.dumps(result)
def order_create(): name = u'' + request.form['firstname'] + u' ' + request.form['lastname'] email = request.form['email'] phone = request.form['telephone'] address = u'Вологда, ' + request.form['street'] + u', д.' + request.form[ 'house'] + u', кв.' + request.form['apartment'] products = [] for product in session['bag']: for i in range(int(product['qty'])): products.append(int(product['pid'])) order_info = create_order(name, address, email, phone, products) result = {} if order_info == '': result['status'] = 'false' else: result['status'] = 'true' session['order_id'] = order_info clean_cart() return json.dumps(result)