diff --git a/themes/default/js/cart-summary.js b/themes/default/js/cart-summary.js index 90f3b349b..fc23b431a 100644 --- a/themes/default/js/cart-summary.js +++ b/themes/default/js/cart-summary.js @@ -668,15 +668,28 @@ function updateCartSummary(json) } // Block cart - if (priceDisplayMethod !== 0) + $('#cart_block_shipping_cost').show(); + $('#cart_block_shipping_cost').next().show(); + if (json.total_shipping > 0) { - $('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank)); - $('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping_tax_exc, currencyFormat, currencySign, currencyBlank)); - $('#cart_block_total').html(formatCurrency(json.total_price_without_tax, currencyFormat, currencySign, currencyBlank)); - } else { - $('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank)); - $('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank)); - $('#cart_block_total').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank)); + if (priceDisplayMethod !== 0) + { + $('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank)); + $('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping_tax_exc, currencyFormat, currencySign, currencyBlank)); + $('#cart_block_total').html(formatCurrency(json.total_price_without_tax, currencyFormat, currencySign, currencyBlank)); + } else { + $('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank)); + $('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank)); + $('#cart_block_total').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank)); + } + } + else + { + if (json.carrier.id == null) + { + $('#cart_block_shipping_cost').hide(); + $('#cart_block_shipping_cost').next().hide(); + } } $('#cart_block_tax_cost').html(formatCurrency(json.total_tax, currencyFormat, currencySign, currencyBlank)); @@ -691,21 +704,21 @@ function updateCartSummary(json) $('#total_price').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank)); $('#total_price_without_tax').html(formatCurrency(json.total_price_without_tax, currencyFormat, currencySign, currencyBlank)); $('#total_tax').html(formatCurrency(json.total_tax, currencyFormat, currencySign, currencyBlank)); - + + $('.cart_total_delivery').show(); if (json.total_shipping > 0) { if (priceDisplayMethod !== 0) - { $('#total_shipping').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank)); - } else - { $('#total_shipping').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank)); - } } else { - $('#total_shipping').html(freeShippingTranslation); + if (json.carrier.id != null) + $('#total_shipping').html(freeShippingTranslation); + else + $('.cart_total_delivery').hide(); } if (json.free_ship > 0 && !json.is_virtual_cart) diff --git a/themes/default/shopping-cart.tpl b/themes/default/shopping-cart.tpl index a0c16e45f..1c97fa8cb 100644 --- a/themes/default/shopping-cart.tpl +++ b/themes/default/shopping-cart.tpl @@ -138,7 +138,7 @@ {if $total_shipping_tax_exc <= 0 && !isset($virtualCart)} -