function calculateTotal()

in frontend/src/pages/Checkout.js [34:50]


    function calculateTotal() {
      var total = 0;
      var _item = null;

      cart.items.map((item) => {
        var _product = items.filter(function (el) {
          return el.id === item.id;
        });

        _product.length === 1 ? (_item = _product[0]) : (_item = null);
        total += _item.itemPrice * item.quantity;
        return null;
      });

      setTotal(parseFloat(total).toFixed(2));
      return parseFloat(total).toFixed(2);
    }