diff --git a/themes/default-bootstrap/js/products-comparison.js b/themes/default-bootstrap/js/products-comparison.js index 75666fe4c..5595d9f65 100644 --- a/themes/default-bootstrap/js/products-comparison.js +++ b/themes/default-bootstrap/js/products-comparison.js @@ -58,11 +58,12 @@ function addToCompare(productId){ function compareButtonsStatusRefresh(){ $('.addToCompare').each(function() { - if ($.inArray(parseInt($(this).prop('rel')),comparedProductsIds)!= -1){ + console.log($(this).data('id-product')); + if ($.inArray(parseInt($(this).data('id-product')),comparedProductsIds)!= -1){ $(this).addClass('checked'); } else { - $(this).removeClass('checked'); + $(this).removeClass('checked'); } }) } @@ -74,19 +75,19 @@ function totalValue(value) { reloadProductComparison = function() { $('a.cmp_remove').click(function(){ - var idProduct = $(this).prop('rel').replace('ajax_id_product_', ''); + var idProduct = $(this).data('id-product'); $.ajax({ - url: 'index.php?controller=products-comparison&ajax=1&action=remove&id_product=' + idProduct, - async: false, - cache: false, - success: function(){ + url: 'index.php?controller=products-comparison&ajax=1&action=remove&id_product=' + idProduct, + async: false, + cache: false, + success: function(){ return true; } - }); + }); }); } $(document).ready(function() { - compareButtonsStatusRefresh(); + compareButtonsStatusRefresh(); }); \ No newline at end of file diff --git a/themes/default-bootstrap/product-list.tpl b/themes/default-bootstrap/product-list.tpl index ee6152b40..cf3133be7 100644 --- a/themes/default-bootstrap/product-list.tpl +++ b/themes/default-bootstrap/product-list.tpl @@ -130,7 +130,7 @@ {hook h='displayProductListFunctionalButtons' product=$product} {if isset($comparator_max_item) && $comparator_max_item}
- {l s='Add to Compare'} + {l s='Add to Compare'}
{/if} diff --git a/themes/default-bootstrap/products-comparison.tpl b/themes/default-bootstrap/products-comparison.tpl index 76fbf314c..7b9043d19 100644 --- a/themes/default-bootstrap/products-comparison.tpl +++ b/themes/default-bootstrap/products-comparison.tpl @@ -50,7 +50,7 @@
- +
@@ -115,7 +115,7 @@ {if ($product->quantity > 0 OR $product->allow_oosp)} id}&token={$static_token}&add")|escape:'html'}" title="{l s='Add to cart'}"> {l s='Add to cart'}