def add_extra_cart_row(self, cart, request): if not self.is_active(cart) and len( cart_modifiers_pool.get_shipping_modifiers()) > 1: return # add a shipping flat fee amount = Money('5') instance = {'label': _("Shipping costs"), 'amount': amount} cart.extra_rows[self.identifier] = ExtraCartRow(instance) cart.total += amount
def add_extra_cart_row(self, cart, request): """ Add a field on cart.extra_price_fields: """ amount = cart.subtotal * self.taxes instance = { 'label': _("{}% VAT incl.").format(settings.VALUE_ADDED_TAX), 'amount': amount, } cart.extra_rows[self.identifier] = ExtraCartRow(instance)