Beispiel #1
0
def updateOrderProduct():
    total_price = 0
    order_number = random.randint(0,999999)
    order = getOrderByCartStatus(session['user_id'])
    for i in OrderProduct.listOrderProductById(order.id):
        total_price += i.price*i.quantity
    Order.updateOrderStatus(order.id, OrderStatus.getNameStatus('Created').id, total_price, order_number)
    return make_response(jsonify({'message':'success'}),200)
Beispiel #2
0
def listOrderProductByOrderId(order_id):
    validate_order_id(order_id)
    return OrderProduct.listOrderProductById(order_id)