[-] FO : fixed bug #PSCFV-7381 - free shipping when no carrier available

This commit is contained in:
vAugagneur
2013-01-25 09:54:08 +01:00
parent b2a10179be
commit 42c150e2a7
2 changed files with 28 additions and 15 deletions
+26 -13
View File
@@ -668,15 +668,28 @@ function updateCartSummary(json)
} }
// Block cart // 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)); if (priceDisplayMethod !== 0)
$('#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)); $('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank));
} else { $('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping_tax_exc, currencyFormat, currencySign, currencyBlank));
$('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank)); $('#cart_block_total').html(formatCurrency(json.total_price_without_tax, currencyFormat, currencySign, currencyBlank));
$('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank)); } else {
$('#cart_block_total').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank)); $('#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)); $('#cart_block_tax_cost').html(formatCurrency(json.total_tax, currencyFormat, currencySign, currencyBlank));
@@ -692,20 +705,20 @@ function updateCartSummary(json)
$('#total_price_without_tax').html(formatCurrency(json.total_price_without_tax, 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)); $('#total_tax').html(formatCurrency(json.total_tax, currencyFormat, currencySign, currencyBlank));
$('.cart_total_delivery').show();
if (json.total_shipping > 0) if (json.total_shipping > 0)
{ {
if (priceDisplayMethod !== 0) if (priceDisplayMethod !== 0)
{
$('#total_shipping').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank)); $('#total_shipping').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank));
}
else else
{
$('#total_shipping').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank)); $('#total_shipping').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank));
}
} }
else 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) if (json.free_ship > 0 && !json.is_virtual_cart)
+1 -1
View File
@@ -138,7 +138,7 @@
</td> </td>
</tr> </tr>
{if $total_shipping_tax_exc <= 0 && !isset($virtualCart)} {if $total_shipping_tax_exc <= 0 && !isset($virtualCart)}
<tr class="cart_total_delivery"> <tr class="cart_total_delivery" style="{if !isset($carrier->id) || is_null($carrier->id)}display:none;{/if}">
<td colspan="5">{l s='Shipping:'}</td> <td colspan="5">{l s='Shipping:'}</td>
<td colspan="2" class="price" id="total_shipping">{l s='Free Shipping!'}</td> <td colspan="2" class="price" id="total_shipping">{l s='Free Shipping!'}</td>
</tr> </tr>