def update(self):
        subtotal = float(0)
        total = float(0)
        for product in self.items:
            subtotal += float(product["price"])
        if subtotal > 0:
            total = subtotal + self.extra_amount
        self.subtotal = subtotal
        self.total = total
dataset/ETHPy150Open rochacbruno/python-pagseguro/examples/flask/flask_seguro/cart.py/Cart.update/original