From 33b5327b4db66390af57600f7d9899fe1a5ff953 Mon Sep 17 00:00:00 2001 From: Kevin Granger Date: Wed, 4 Dec 2013 16:58:34 +0100 Subject: [PATCH 1/7] // data-id-product instead of using rel tag --- .../js/products-comparison.js | 19 ++++++++++--------- themes/default-bootstrap/product-list.tpl | 2 +- .../default-bootstrap/products-comparison.tpl | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) 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'} From ad1c7b39623cea1ec90c28939d1ea809cb85231d Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Wed, 4 Dec 2013 16:59:00 +0100 Subject: [PATCH 2/7] // update product-list itemproperty --- themes/default-bootstrap/product-list.tpl | 128 ++++++++++++++++++---- 1 file changed, 106 insertions(+), 22 deletions(-) diff --git a/themes/default-bootstrap/product-list.tpl b/themes/default-bootstrap/product-list.tpl index ee6152b40..f2834916f 100644 --- a/themes/default-bootstrap/product-list.tpl +++ b/themes/default-bootstrap/product-list.tpl @@ -48,43 +48,99 @@ {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if} {if $totModuloMobile == 0}{assign var='totModuloMobile' value=$nbItemsPerLineMobile}{/if}
  • -
    +
    - - {if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if} + - {if isset($quick_view) && $quick_view}Quick view{/if} + {if isset($quick_view) && $quick_view} + + Quick view + + {/if} {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} -
    +
    {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} - {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} + + {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} + + {if isset($product.specific_prices) && $product.specific_prices} - {displayWtPrice p=$product.price_without_reduction} - {if isset($product.specific_prices.reduction) && $product.specific_prices.reduction && $product.specific_prices.reduction_type == 'percentage'}-{$product.specific_prices.reduction * 100}%{/if} + + {displayWtPrice p=$product.price_without_reduction} + + {if isset($product.specific_prices.reduction) && $product.specific_prices.reduction && $product.specific_prices.reduction_type == 'percentage'} + -{$product.specific_prices.reduction * 100}% + {/if} {/if} {/if}
    {/if} - {if isset($product.new) && $product.new == 1}{l s='New'}{/if} - {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}{l s='Sale!'}{/if} + {if isset($product.new) && $product.new == 1} + + {l s='New'} + + {/if} + {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} + + {l s='Sale!'} + + {/if}
    -
    {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}{$product.name|truncate:45:'...'|escape:'html':'UTF-8'}
    +
    + {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if} + +
    + {hook h='displayProductListReviews' product=$product} -

    {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}

    + +

    + {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} +

    + {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} -
    +
    {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} - {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} + + {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} + + {if isset($product.specific_prices) && $product.specific_prices} - {displayWtPrice p=$product.price_without_reduction} - {if isset($product.specific_prices.reduction) && $product.specific_prices.reduction && $product.specific_prices.reduction_type == 'percentage'}-{$product.specific_prices.reduction * 100}%{/if} + + {displayWtPrice p=$product.price_without_reduction} + + {if isset($product.specific_prices.reduction) && $product.specific_prices.reduction && $product.specific_prices.reduction_type == 'percentage'} + -{$product.specific_prices.reduction * 100}% + {/if} {/if} {/if}
    {/if} +
    {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity > 0)} @@ -111,21 +167,49 @@ {l s='Add to cart'} {/if} {/if} - {l s='More'} +
    - {if isset($product.color_list)}
    {$product.color_list}
    {/if} + {if isset($product.color_list)} +
    {$product.color_list}
    + {/if} +
    {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} - {if isset($product.online_only) && $product.online_only}{l s='Online only'}{/if} + {if isset($product.online_only) && $product.online_only} + {l s='Online only'} + {/if} {/if} {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} - {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}{l s='Reduced price!'}{/if} -
    + {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} + {l s='Reduced price!'} + {/if} +
    + {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} - {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}{if ($product.allow_oosp || $product.quantity > 0)}{l s='In Stock'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}{/if} + {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)} + + {if ($product.allow_oosp || $product.quantity > 0)} + + {l s='In Stock'} + + {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)} + + {l s='Product available with different options'} + + {else} + + {l s='Out of stock'} + + {/if} + + {/if} {/if} +
    +
    {hook h='displayProductListFunctionalButtons' product=$product} {if isset($comparator_max_item) && $comparator_max_item} From ab71b813beb4115d62d19e609542bc0250ae5716 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Wed, 4 Dec 2013 17:00:12 +0100 Subject: [PATCH 3/7] [-] BO : fixed top right link with the "open in a new tab" button --- admin-dev/themes/default/template/header.tpl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl index 0026dc496..81c8e775b 100644 --- a/admin-dev/themes/default/template/header.tpl +++ b/admin-dev/themes/default/template/header.tpl @@ -36,7 +36,6 @@ {$shop_name} {if $meta_title != ''}{if isset($navigationPipe)}{$navigationPipe|escape:'html':'UTF-8'}{else}>{/if} {$meta_title}{/if} {if $display_header} -