[-] MO : #PSCFV-3057 - Block cart: If no products, block cart is never displayed

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16245 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-07-05 15:04:20 +00:00
parent 64648e0826
commit 51179caeff
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -27,6 +27,7 @@
//JS Object : update the cart by ajax actions
var ajaxCart = {
nb_total_products: 0,
//override every button in the page in relation to the cart
overrideButtonsInThePage : function(){
@@ -311,9 +312,10 @@ var ajaxCart = {
$('#'+removedProductId).addClass('strike').fadeTo('slow', 0, function(){
$(this).slideUp('slow', function(){
$(this).remove();
//if the cart is now empty, show the 'no product in the cart' message
// If the cart is now empty, show the 'no product in the cart' message and close detail
if($('#cart_block dl.products dt').length == 0)
{
$("#header #cart_block").stop(true, true).slideUp(200);
$('p#cart_block_no_products:hidden').slideDown(450);
$('div#cart_block dl.products').remove();
}
@@ -601,6 +603,9 @@ var ajaxCart = {
$('.ajax_cart_tax_cost').text(jsonData.taxCost);
$('.cart_block_wrapping_cost').text(jsonData.wrappingCost);
$('.ajax_block_cart_total').text(jsonData.total);
this.nb_total_products = jsonData.nbTotalProducts;
if(parseInt(jsonData.nbTotalProducts) > 0)
{
$('.ajax_cart_no_product').hide();
@@ -674,7 +679,8 @@ $(document).ready(function(){
$("#shopping_cart a:first").hover(
function() {
$(this).css('border-radius', '3px 3px 0px 0px');
$("#header #cart_block").stop(true, true).slideDown(450);
if (ajaxCart.nb_total_products > 0)
$("#header #cart_block").stop(true, true).slideDown(450);
},
function() {
$('#shopping_cart a').css('border-radius', '3px');
+1 -1
View File
@@ -35,7 +35,7 @@
"link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|addslashes|replace:'\\\'':'\''}",
"quantity": {$product.cart_quantity},
"priceByLine": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
"name": "{$product.name|html_entity_decode:2:'UTF-8'|escape|truncate:15:'...':true}",
"name": "{$product.name|html_entity_decode:2:'UTF-8'|escape:'htmlall'|truncate:15:'...':true}",
"price": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
"price_float": "{$product.total}",
"idCombination": {if isset($product.attributes_small)}{$productAttributeId}{else}0{/if},