def update(self):
        """ Remove items in cart """

        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
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
Remove items in cart