diff --git a/app/assets/javascripts/spree/frontend/checkout/shipment.js b/app/assets/javascripts/spree/frontend/checkout/shipment.js index bf3b063657..bc4d0c7d14 100644 --- a/app/assets/javascripts/spree/frontend/checkout/shipment.js +++ b/app/assets/javascripts/spree/frontend/checkout/shipment.js @@ -19,10 +19,12 @@ ShippingTotalManager.prototype.calculateShipmentTotal = function () { var checked = $(this.shippingMethods).filter(':checked') this.sum = 0 this.tax = this.parseCurrencyToFloat(this.nonShipmentTax) - $.each(checked, function (idx, shippingMethod) { - this.sum += this.parseCurrencyToFloat($(shippingMethod).data('cost')) - this.tax += this.parseCurrencyToFloat($(shippingMethod).data('tax')) - }.bind(this)) + if (!this.isFreeShipping.html()) { + $.each(checked, function (idx, shippingMethod) { + this.sum += this.parseCurrencyToFloat($(shippingMethod).data('cost')) + this.tax += this.parseCurrencyToFloat($(shippingMethod).data('tax')) + }.bind(this)) + } return this.readjustSummarySection( this.parseCurrencyToFloat(this.orderTotal.html()), this.sum, diff --git a/app/views/spree/checkout/_summary.html.erb b/app/views/spree/checkout/_summary.html.erb index 7186d7b843..c09e8f2c42 100644 --- a/app/views/spree/checkout/_summary.html.erb +++ b/app/views/spree/checkout/_summary.html.erb @@ -29,6 +29,13 @@ <% if order.has_free_shipping? %>
<%= Spree.t(:shipping) %>:
<%= Spree.t(:free) %>
+ <% shipping_total = Spree::Money.new(0.0, currency: order.currency) %> +
<% else %>
<%= Spree.t(:shipping) %>:
<% shipping_total = Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency) %>