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

This commit is contained in:
vAugagneur committed 2013-01-25 09:54:08 +01:00
1 parent b2a10179be
commit 42c150e2a7
2 files changed
+18 -5

No files matched your search

+17 -4
View File
@@ -668,6 +668,10 @@ function updateCartSummary(json)
} }
// Block cart // Block cart
$('#cart_block_shipping_cost').show();
$('#cart_block_shipping_cost').next().show();
if (json.total_shipping > 0)
{
if (priceDisplayMethod !== 0) if (priceDisplayMethod !== 0)
{ {
$('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank)); $('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank));
@@ -678,6 +682,15 @@ function updateCartSummary(json)
$('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping, 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)); $('#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));
$('.ajax_cart_quantity').html(nbrProducts); $('.ajax_cart_quantity').html(nbrProducts);
@@ -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
{ {
if (json.carrier.id != null)
$('#total_shipping').html(freeShippingTranslation); $('#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>