[-] FO : #PSCFV-1463 - Disallow removing free product from the blockcart
This commit is contained in:
@@ -350,6 +350,8 @@ var ajaxCart = {
|
||||
var removeLinks = $('#cart_block_product_' + domIdProduct).find('a.ajax_cart_block_remove_link');
|
||||
if (!product.hasCustomizedDatas && !removeLinks.length)
|
||||
$('#' + domIdProduct + ' span.remove_link').html('<a class="ajax_cart_block_remove_link" rel="nofollow" href="' + baseDir + 'index.php?controller=cart&delete&id_product=' + product['id'] + '&ipa=' + product['idCombination'] + '&token=' + static_token + '"> </a>');
|
||||
if (parseInt(product.price_float) <= 0)
|
||||
$('#' + domIdProduct + ' span.remove_link').html('');
|
||||
},
|
||||
|
||||
doesCustomizationStillExist : function (product, customizationId)
|
||||
@@ -436,12 +438,17 @@ var ajaxCart = {
|
||||
var productId = parseInt(this.id);
|
||||
var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0);
|
||||
var content = '<dt class="hidden" id="cart_block_product_' + domIdProduct + '">';
|
||||
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 + '">' + name + '</a>';
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseDir + 'index.php?controller=cart&delete&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
content += '<span class="price">' + (parseFloat(this.price_float) > 0 ? this.priceByLine : freeProductTranslation) + '</span>';
|
||||
content += '</dt>';
|
||||
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 + '">' + name + '</a>';
|
||||
|
||||
if (parseFloat(this.price_float) > 0)
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseDir + 'index.php?controller=cart&delete&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
else
|
||||
content += '<span class="remove_link"></span>';
|
||||
|
||||
content += '<span class="price">' + (parseFloat(this.price_float) > 0 ? this.priceByLine : freeProductTranslation) + '</span>';
|
||||
content += '</dt>';
|
||||
if (this.hasAttributes)
|
||||
content += '<dd id="cart_block_combination_of_' + domIdProduct + '" class="hidden"><a href="' + this.link + '" title="' + this.name + '">' + this.attributes + '</a>';
|
||||
if (this.hasCustomizedDatas)
|
||||
|
||||
Reference in New Issue
Block a user