Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[*] MO : blockcart - simpler selectors
- Loading branch information
Grégoire Bélorgey
committed
May 28, 2013
1 parent
3c129a0
commit 1652f35
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,7 +313,7 @@ var ajaxCart = { | |
// 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); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gbelorgey
|
||
$("#cart_block").stop(true, true).slideUp(200); | ||
$('#cart_block_no_products:hidden').slideDown(450); | ||
$('#cart_block dl.products').remove(); | ||
} | ||
|
@@ -377,7 +377,7 @@ var ajaxCart = { | |
else | ||
{ | ||
$('#vouchers tbody').html(''); | ||
|
||
for (i=0;i<jsonData.discounts.length;i++) | ||
{ | ||
if (parseFloat(jsonData.discounts[i].price_float) > 0) | ||
|
@@ -428,7 +428,7 @@ var ajaxCart = { | |
if (this.id != undefined) | ||
{ | ||
//create a container for listing the products and hide the 'no product in the cart' message (only if the cart was empty) | ||
|
||
if ($('#cart_block dl.products').length == 0) | ||
{ | ||
$('#cart_block_no_products').before('<dl class="products"></dl>'); | ||
|
@@ -445,7 +445,7 @@ var ajaxCart = { | |
content += '<span class="quantity-formated"><span class="quantity">' + this.quantity + '</span>x</span>'; | ||
var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name); | ||
content += '<a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a>'; | ||
|
||
if (parseFloat(this.price_float) > 0) | ||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>'; | ||
else | ||
|
@@ -595,7 +595,7 @@ var ajaxCart = { | |
//update general cart informations everywhere in the page | ||
updateCartEverywhere : function(jsonData) { | ||
$('.ajax_cart_total').text($.trim(jsonData.productTotal)); | ||
|
||
if (parseFloat(jsonData.shippingCostFloat) > 0 || jsonData.nbTotalProducts < 1) | ||
$('.ajax_cart_shipping_cost').text(jsonData.shippingCost); | ||
else if (typeof(freeShippingTranslation) != 'undefined') | ||
|
@@ -605,7 +605,7 @@ var ajaxCart = { | |
$('.ajax_block_cart_total').text(jsonData.total); | ||
|
||
this.nb_total_products = jsonData.nbTotalProducts; | ||
|
||
if (parseInt(jsonData.nbTotalProducts) > 0) | ||
{ | ||
$('.ajax_cart_no_product').hide(); | ||
|
@@ -689,10 +689,10 @@ $(document).ready(function(){ | |
$("#cart_block").stop(true, true).slideDown(450); | ||
}, | ||
function() { | ||
$('#header #shopping_cart a').css('border-radius', '3px'); | ||
$('#shopping_cart a').css('border-radius', '3px'); | ||
setTimeout(function() { | ||
if (!shopping_cart.isHoveringOver() && !cart_block.isHoveringOver()) | ||
$("#header #cart_block").stop(true, true).slideUp(450); | ||
$("#cart_block").stop(true, true).slideUp(450); | ||
}, 200); | ||
} | ||
); | ||
|
@@ -705,17 +705,17 @@ $(document).ready(function(){ | |
$('#shopping_cart a').css('border-radius', '3px'); | ||
setTimeout(function() { | ||
if (!shopping_cart.isHoveringOver()) | ||
$("#header #cart_block").stop(true, true).slideUp(450); | ||
$("#cart_block").stop(true, true).slideUp(450); | ||
}, 200); | ||
} | ||
); | ||
|
||
$('.delete_voucher').live('click', function() { | ||
$.ajax({ | ||
type: 'POST', | ||
type: 'POST', | ||
headers: { "cache-control": "no-cache" }, | ||
async: true, | ||
cache: false, | ||
cache: false, | ||
url:$(this).attr('href') + '?rand=' + new Date().getTime() | ||
}); | ||
$(this).parent().parent().remove(); | ||
|
Hi,
header selector was totaly required here and below ! This created a regression from commit of http://forge.prestashop.com/browse/PSCFV-7495 reported again here http://forge.prestashop.com/browse/PSCFV-10497
Best regards