From 73e3e447f6afefce3035c9b288647bdf7d4eeed7 Mon Sep 17 00:00:00 2001 From: djfm Date: Wed, 4 Dec 2013 14:09:34 +0000 Subject: [PATCH 01/14] // typo in default theme blockcart.tpl --- themes/default-bootstrap/modules/blockcart/blockcart.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default-bootstrap/modules/blockcart/blockcart.tpl b/themes/default-bootstrap/modules/blockcart/blockcart.tpl index af543f92f..50915e8d4 100644 --- a/themes/default-bootstrap/modules/blockcart/blockcart.tpl +++ b/themes/default-bootstrap/modules/blockcart/blockcart.tpl @@ -230,7 +230,7 @@ var generated_date = {$smarty.now|intval};
{l s='Continue shopping' mod='blockcart'} - {l s='Proceed to checkout' mod='blockcart'} + {l s='Proceed to checkout' mod='blockcart'}
From cb9dd448e146e1f4e47a53ca457eee4622070871 Mon Sep 17 00:00:00 2001 From: djfm Date: Wed, 4 Dec 2013 14:14:01 +0000 Subject: [PATCH 02/14] // another typo in default theme blockcart.tpl --- themes/default-bootstrap/modules/blockcart/blockcart.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default-bootstrap/modules/blockcart/blockcart.tpl b/themes/default-bootstrap/modules/blockcart/blockcart.tpl index 50915e8d4..39ea46550 100644 --- a/themes/default-bootstrap/modules/blockcart/blockcart.tpl +++ b/themes/default-bootstrap/modules/blockcart/blockcart.tpl @@ -215,7 +215,7 @@ var generated_date = {$smarty.now|intval}; {/if}
- {l s='Total shipping (tax exclu.):' mod='blockcart'} + {l s='Total shipping (tax excl.):' mod='blockcart'} {if $shipping_cost_float == 0}{l s='Free shipping!' mod='blockcart'}{else}{$shipping_cost}{/if}
{if $show_tax && isset($tax_cost)} From c127f9765a375638b2ffbfe2c7590ddbef6abd08 Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Wed, 4 Dec 2013 15:17:35 +0100 Subject: [PATCH 03/14] // update code on footer and header --- themes/default-bootstrap/footer.tpl | 24 +-- themes/default-bootstrap/header.tpl | 312 ++++++++++++++-------------- 2 files changed, 172 insertions(+), 164 deletions(-) diff --git a/themes/default-bootstrap/footer.tpl b/themes/default-bootstrap/footer.tpl index 63d62cee5..f572a7af1 100644 --- a/themes/default-bootstrap/footer.tpl +++ b/themes/default-bootstrap/footer.tpl @@ -23,16 +23,16 @@ * International Registered Trademark & Property of PrestaShop SA *} {if !$content_only} - - {if isset($right_column_size) && !empty($right_column_size)} - -
- {$HOOK_RIGHT_COLUMN} -
- {/if} - - - + + {if isset($right_column_size) && !empty($right_column_size)} + +
+ {$HOOK_RIGHT_COLUMN} +
+ {/if} + + + - + + {/if} diff --git a/themes/default-bootstrap/header.tpl b/themes/default-bootstrap/header.tpl index c63b54d15..fd7fa552c 100644 --- a/themes/default-bootstrap/header.tpl +++ b/themes/default-bootstrap/header.tpl @@ -27,22 +27,37 @@ - + {$meta_title|escape:'html':'UTF-8'} -{if isset($meta_description) AND $meta_description} - -{/if} -{if isset($meta_keywords) AND $meta_keywords} - -{/if} - - + {if isset($meta_description) AND $meta_description} + + {/if} + {if isset($meta_keywords) AND $meta_keywords} + + {/if} + - - - - - - - - - - - - -{if isset($css_files)} - {foreach from=$css_files key=css_uri item=media} - - {/foreach} -{/if} -{if isset($js_files)} - {foreach from=$js_files item=js_uri} - - {/foreach} -{/if} - - - - - - - - - + {if isset($js_files)} + {foreach from=$js_files item=js_uri} + + {/foreach} + {/if} + + + + + + + + + {$HOOK_HEADER} @@ -103,117 +104,124 @@ {/if}
-
- -
-
-
- {if $page_name !='index' && $page_name !='pagenotfound'} - {include file="$tpl_dir./breadcrumb.tpl"} - {/if} -
+
+ +
+ +
+
+ {if $page_name !='index' && $page_name !='pagenotfound'} + {include file="$tpl_dir./breadcrumb.tpl"} + {/if} +
{if isset($left_column_size) && !empty($left_column_size)} -
+
{$HOOK_LEFT_COLUMN} -
+
{/if} - -
+ +
{/if} \ No newline at end of file From ad6ed3dcf130e6397cac88d0843a1b25ea8a749d Mon Sep 17 00:00:00 2001 From: Kevin Granger Date: Wed, 4 Dec 2013 15:46:42 +0100 Subject: [PATCH 04/14] // data-id-product instead of using rel tag --- .../js/modules/blockcart/ajax-cart.js | 2 +- .../mobile/product-desc-features.tpl | 15 +- .../modules/blockwishlist/view.tpl | 178 ++++++------ themes/default-bootstrap/product-list.tpl | 204 +++++++------- themes/default-bootstrap/product.tpl | 253 +++++++++--------- .../default-bootstrap/products-comparison.tpl | 94 ++++--- 6 files changed, 401 insertions(+), 345 deletions(-) diff --git a/themes/default-bootstrap/js/modules/blockcart/ajax-cart.js b/themes/default-bootstrap/js/modules/blockcart/ajax-cart.js index 63e198425..23c36ec02 100644 --- a/themes/default-bootstrap/js/modules/blockcart/ajax-cart.js +++ b/themes/default-bootstrap/js/modules/blockcart/ajax-cart.js @@ -35,7 +35,7 @@ var ajaxCart = { overrideButtonsInThePage : function(){ //for every 'add' buttons... $('.ajax_add_to_cart_button').unbind('click').click(function(){ - var idProduct = $(this).attr('rel').replace('nofollow', '').replace('ajax_id_product_', ''); + var idProduct = $(this).data('id-product'); if ($(this).attr('disabled') != 'disabled') ajaxCart.add(idProduct, null, false, this); return false; diff --git a/themes/default-bootstrap/mobile/product-desc-features.tpl b/themes/default-bootstrap/mobile/product-desc-features.tpl index deca914b6..902de67e1 100644 --- a/themes/default-bootstrap/mobile/product-desc-features.tpl +++ b/themes/default-bootstrap/mobile/product-desc-features.tpl @@ -72,7 +72,20 @@ {assign var="btn_class" value="disabled"} {capture assign="btn_more"}{if (isset($accessory.quantity_all_versions) && $accessory.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{if !$PS_CATALOG_MODE}{l s='Out of stock'}{/if}{/if}{/capture} {/if} - {l s='Add to cart'} + + {l s='Add to cart'} + {$btn_more}
diff --git a/themes/default-bootstrap/modules/blockwishlist/view.tpl b/themes/default-bootstrap/modules/blockwishlist/view.tpl index f66fcf265..4ceaa44c6 100644 --- a/themes/default-bootstrap/modules/blockwishlist/view.tpl +++ b/themes/default-bootstrap/modules/blockwishlist/view.tpl @@ -23,88 +23,100 @@ * International Registered Trademark & Property of PrestaShop SA *}
-

{l s='Wishlist' mod='blockwishlist'}

-{if $wishlists} -

- {l s='Other wishlists of' mod='blockwishlist'} {$current_wishlist.firstname} {$current_wishlist.lastname}: - {foreach from=$wishlists item=wishlist name=i} - {if $wishlist.id_wishlist != $current_wishlist.id_wishlist} - {$wishlist.name} - {if !$smarty.foreach.i.last} - / +

{l s='Wishlist' mod='blockwishlist'}

+ {if $wishlists} +

+ {l s='Other wishlists of' mod='blockwishlist'} {$current_wishlist.firstname} {$current_wishlist.lastname}: + {foreach from=$wishlists item=wishlist name=i} + {if $wishlist.id_wishlist != $current_wishlist.id_wishlist} + {$wishlist.name} + {if !$smarty.foreach.i.last} + / + {/if} {/if} - {/if} - {/foreach} -

-{/if} + {/foreach} +

+ {/if} -
- {assign var='nbItemsPerLine' value=3} - {assign var='nbItemsPerLineTablet' value=2} - {assign var='nbLi' value=$products|@count} - {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} - {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet} -
    - {foreach from=$products item=product name=i} - {math equation="(total%perLine)" total=$smarty.foreach.i.total perLine=$nbItemsPerLine assign=totModulo} - {math equation="(total%perLineT)" total=$smarty.foreach.i.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet} - {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} - {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if} -
  • -
    -
    -
    - - {$product.name|escape:'html':'UTF-8'} - -
    -
    -
    -
    -

    - {$product.name|truncate:30:'...'|escape:'html':'UTF-8'} - {if isset($product.attributes_small)} - {$product.attributes_small|escape:'html':'UTF-8'} - {/if} -

    -
    -

    - - -

    -

    - - -

    -
    - {if isset($product.attribute_quantity) AND $product.attribute_quantity >= 1 OR !isset($product.attribute_quantity) AND $product.product_quantity >= 1} - {if !$ajax} -
    - -
    - {/if} - {l s='Add to cart' mod='blockwishlist'} - {else} - {l s='Add to cart' mod='blockwishlist'} - {/if} - {l s='View' mod='blockwishlist'} -
    -
    -
    -
    -
    -
  • - {/foreach} -
-
- -
+
+ {assign var='nbItemsPerLine' value=3} + {assign var='nbItemsPerLineTablet' value=2} + {assign var='nbLi' value=$products|@count} + {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} + {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet} +
    + {foreach from=$products item=product name=i} + {math equation="(total%perLine)" total=$smarty.foreach.i.total perLine=$nbItemsPerLine assign=totModulo} + {math equation="(total%perLineT)" total=$smarty.foreach.i.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet} + {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} + {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if} +
  • +
    +
    +
    + + {$product.name|escape:'html':'UTF-8'} + +
    +
    +
    +
    +

    + {$product.name|truncate:30:'...'|escape:'html':'UTF-8'} + {if isset($product.attributes_small)} + {$product.attributes_small|escape:'html':'UTF-8'} + {/if} +

    +
    +

    + + +

    +

    + + +

    +
    + {if isset($product.attribute_quantity) AND $product.attribute_quantity >= 1 OR !isset($product.attribute_quantity) AND $product.product_quantity >= 1} + {if !$ajax} +
    + +
    + {/if} + + {l s='Add to cart' mod='blockwishlist'} + + {else} + {l s='Add to cart' mod='blockwishlist'} + {/if} + + {l s='View' mod='blockwishlist'} + +
    +
    +
    +
    +
    +
  • + {/foreach} +
+
+
\ No newline at end of file diff --git a/themes/default-bootstrap/product-list.tpl b/themes/default-bootstrap/product-list.tpl index 35dcb8253..ee6152b40 100644 --- a/themes/default-bootstrap/product-list.tpl +++ b/themes/default-bootstrap/product-list.tpl @@ -22,104 +22,119 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} + {if isset($products)} {*define numbers of product per line in other page for desktop*} {if $page_name !='index' && $page_name !='product'} {assign var='nbItemsPerLine' value=3} - {assign var='nbItemsPerLineTablet' value=2} - {assign var='nbItemsPerLineMobile' value=3} - {else} - {assign var='nbItemsPerLine' value=4} - {assign var='nbItemsPerLineTablet' value=3} - {assign var='nbItemsPerLineMobile' value=2} - {/if} - {*define numbers of product per line in other page for tablet*} - {assign var='nbLi' value=$products|@count} - {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} - {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet} + {assign var='nbItemsPerLineTablet' value=2} + {assign var='nbItemsPerLineMobile' value=3} + {else} + {assign var='nbItemsPerLine' value=4} + {assign var='nbItemsPerLineTablet' value=3} + {assign var='nbItemsPerLineMobile' value=2} + {/if} + {*define numbers of product per line in other page for tablet*} + {assign var='nbLi' value=$products|@count} + {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} + {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet}
    {foreach from=$products item=product name=products} - {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo} - {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet} - {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineMobile assign=totModuloMobile} - {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} - {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if} - {if $totModuloMobile == 0}{assign var='totModuloMobile' value=$nbItemsPerLineMobile}{/if} + {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo} + {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet} + {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineMobile assign=totModuloMobile} + {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} + {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 (!$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 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} - {/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.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}{$product.name|truncate:45:'...'|escape:'html':'UTF-8'}
    - {hook h='displayProductListReviews' product=$product} -

    {$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 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} - {/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)} - {if isset($static_token)} - {l s='Add to cart'} - {else} - {l s='Add to cart'} - {/if} - {else} - {l s='Add to cart'} - {/if} - {/if} - {l s='More'} -
    - - {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} - {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} -
    - {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} -
    -
    +
    +
    +
    + + {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 (!$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 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} + {/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.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}{$product.name|truncate:45:'...'|escape:'html':'UTF-8'}
    + {hook h='displayProductListReviews' product=$product} +

    {$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 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} + {/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)} + {if isset($static_token)} + + {l s='Add to cart'} + + {else} + + {l s='Add to cart'} + + {/if} + {else} + {l s='Add to cart'} + {/if} + {/if} + {l s='More'} +
    + + {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} + {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} +
    + {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} +
    +
    {hook h='displayProductListFunctionalButtons' product=$product} - {if isset($comparator_max_item) && $comparator_max_item} - - {/if} -
    -
    + {if isset($comparator_max_item) && $comparator_max_item} + + {/if} +
    +
  • {/foreach}
@@ -129,10 +144,10 @@ var comparator_max_item = {$comparator_max_item}; var comparedProductsIds = []; {foreach from=$compared_products key=k item=product}comparedProductsIds.push({$product});{/foreach} - $('document').ready(function(){ - blockHover(); - }); - + $('document').ready(function(){ + blockHover(); + }); + {/if} + {if $page_name !='index' && $page_name !='product'} + //--> {/if} {/if} diff --git a/themes/default-bootstrap/product.tpl b/themes/default-bootstrap/product.tpl index 9899fbdac..650a51947 100644 --- a/themes/default-bootstrap/product.tpl +++ b/themes/default-bootstrap/product.tpl @@ -180,31 +180,31 @@ var contentOnly = {if $content_only}true{else}false{/if} {$confirmation}

{/if} - + - +
- +
- - {if $product->on_sale} + + {if $product->on_sale} {l s='Sale!'} {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutReduction > $productPrice} {l s='Reduced price!'} {/if} - + {if $have_image} {if $jqZoomEnabled && $have_image && !$content_only} - - {if !empty($cover.legend)}{$cover.legend|escape:'html'}{else}{$product->name|escape:'html'}{/if} - - {else} - {if !empty($cover.legend)}{$cover.legend|escape:'html'}{else}{$product->name|escape:'html'}{/if} + + {if !empty($cover.legend)}{$cover.legend|escape:'html'}{else}{$product->name|escape:'html'}{/if} + + {else} + {if !empty($cover.legend)}{$cover.legend|escape:'html'}{else}{$product->name|escape:'html'}{/if} {if !$content_only}{l s='View larger'}{/if} - {/if} + {/if} {else} @@ -240,18 +240,18 @@ var contentOnly = {if $content_only}true{else}false{/if}
{/if} {if isset($images) && count($images) > 1}

{/if} + {l s='Display all pictures'}

{/if}
- + - +
- - {if $product->online_only} + + {if $product->online_only}

{l s='Online only'}

{/if} - +

{$product->name|escape:'html':'UTF-8'}

reference}style="display: none;"{/if}> @@ -266,18 +266,18 @@ var contentOnly = {if $content_only}true{else}false{/if}

{l s='More details'}

{/if}
{/if} @@ -290,22 +290,22 @@ var contentOnly = {if $content_only}true{else}false{/if} quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items'}

{/if} - +

quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> {*{l s='Availability:'}*} quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}

- +

quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}

- +

quantity > 0) OR !$product->available_for_order OR $PS_CATALOG_MODE OR !isset($product->available_date) OR $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}> {l s='Availability date:'} {dateFormat date=$product->available_date full=false}

- - + +
quantity > 0} style="display: none;"{/if}> @@ -325,7 +325,7 @@ var contentOnly = {if $content_only}true{else}false{/if}
{/if}*} - + {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} @@ -340,30 +340,30 @@ var contentOnly = {if $content_only}true{else}false{/if} {/if} {if isset($HOOK_EXTRA_RIGHT) && $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if} - {if !$content_only} - + {if !$content_only} + - {/if} + {/if}
- - - - + + + +
-
+
- {if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} + {if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}

- quantity <= 0}href="http://schema.org/OutOfStock"{else}href="http://schema.org/InStock"{/if}> + quantity <= 0}href="http://schema.org/OutOfStock"{else}href="http://schema.org/InStock"{/if}> {if $priceDisplay >= 0 && $priceDisplay <= 2} {convertPrice price=$productPrice}

quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> - - - minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> - - + + + minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> + +

- +

minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> @@ -441,7 +441,7 @@ var contentOnly = {if $content_only}true{else}false{/if} checkMinimalQuantity(); {/if} - + {if isset($groups)}

@@ -491,37 +491,37 @@ var contentOnly = {if $content_only}true{else}false{/if} {/foreach}
{/if} - - + +
- -
- -

quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}style="display:none"{/if} class="buttons_bottom_block"> - + +

+ +

quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}style="display:none"{/if} class="buttons_bottom_block"> +

{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if} - -
- -
- -
- - + +
+ +
+ +
+ +
{if !$content_only} {if $product->description} -
-

{l s='More info'}

{/if} - {if isset($product) && $product->description} - -
{$product->description}
-
+
+

{l s='More info'}

{/if} + {if isset($product) && $product->description} + +
{$product->description}
+
{/if} @@ -533,12 +533,12 @@ var contentOnly = {if $content_only}true{else}false{/if} {if isset($features) && $features} {foreach from=$features item=feature} - - {if isset($feature.value)} - - {/if} + + {if isset($feature.value)} + + {/if} - {/foreach} + {/foreach}
{$feature.name|escape:'html':'UTF-8'} {$feature.value|escape:'html':'UTF-8'}
{$feature.name|escape:'html':'UTF-8'} {$feature.value|escape:'html':'UTF-8'}
{/if} @@ -568,27 +568,36 @@ var contentOnly = {if $content_only}true{else}false{/if}
{$accessory.legend|escape:'html':'UTF-8'} - - -
+
{$accessory.name|truncate:20:'...':true|escape:'html':'UTF-8'}
- + {if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} - {if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}{/if} + {if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}{/if}
- +
{if !$PS_CATALOG_MODE && ($accessory.allow_oosp || $accessory.quantity > 0)} - - + +
+ + {/if}
@@ -609,39 +618,39 @@ var contentOnly = {if $content_only}true{else}false{/if}

{l s='Volume discounts'}

- - - - - - - + + + + + + + - {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} - - - - - - - {/foreach} - + {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} + + + + + + + {/foreach} +
{l s='Quantity'}{l s='Discount'}{l s='You Save'}
{l s='Quantity'}{l s='Discount'}{l s='You Save'}
{$quantity_discount.quantity|intval} - {if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'} - {convertPrice price=$quantity_discount.real_value|floatval} - {else} - {$quantity_discount.real_value|floatval}% - {/if} - - {l s='Up to'} - {if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'} - {$discountPrice=$productPrice-$quantity_discount.real_value|floatval} - {else} - {$discountPrice=$productPrice-($productPrice*$quantity_discount.reduction)|floatval} - {/if} - {$discountPrice=$discountPrice*$quantity_discount.quantity} - {$qtyProductPrice = $productPrice*$quantity_discount.quantity} - {convertPrice price=$qtyProductPrice-$discountPrice} -
{$quantity_discount.quantity|intval} + {if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'} + {convertPrice price=$quantity_discount.real_value|floatval} + {else} + {$quantity_discount.real_value|floatval}% + {/if} + + {l s='Up to'} + {if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'} + {$discountPrice=$productPrice-$quantity_discount.real_value|floatval} + {else} + {$discountPrice=$productPrice-($productPrice*$quantity_discount.reduction)|floatval} + {/if} + {$discountPrice=$discountPrice*$quantity_discount.quantity} + {$qtyProductPrice = $productPrice*$quantity_discount.quantity} + {convertPrice price=$qtyProductPrice-$discountPrice} +
{/if} @@ -656,12 +665,12 @@ var contentOnly = {if $content_only}true{else}false{/if} {if isset($attachments) && $attachments} -
-

{l s='Download'}

+
+

{l s='Download'}

{foreach from=$attachments item=attachment} {$attachment.name|escape:'html':'UTF-8'}
{$attachment.description|escape:'html':'UTF-8'} {/foreach} - +
{/if} @@ -729,7 +738,7 @@ var contentOnly = {if $content_only}true{else}false{/if} - +

diff --git a/themes/default-bootstrap/products-comparison.tpl b/themes/default-bootstrap/products-comparison.tpl index 9ad6999e9..74e576e4e 100644 --- a/themes/default-bootstrap/products-comparison.tpl +++ b/themes/default-bootstrap/products-comparison.tpl @@ -36,10 +36,10 @@
- + + {l s='Features:'} + {assign var='taxes_behavior' value=false} {if $use_taxes && (!$priceDisplay || $priceDisplay == 2)} {assign var='taxes_behavior' value=true} @@ -48,37 +48,37 @@ {assign var='replace_id' value=$product->id|cat:'|'} {/foreach} From a8e6dfe7f5e58ed504c5ca2ab6b561e5064a236a Mon Sep 17 00:00:00 2001 From: djfm Date: Wed, 4 Dec 2013 15:03:04 +0000 Subject: [PATCH 05/14] // fixed undefined variable in blocktopmenu --- modules/blocktopmenu/blocktopmenu.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php index d739df782..4555df282 100644 --- a/modules/blocktopmenu/blocktopmenu.php +++ b/modules/blocktopmenu/blocktopmenu.php @@ -962,6 +962,7 @@ class Blocktopmenu extends Module { if ($link['label'] == '') { + $default_language = Configuration::get('PS_LANG_DEFAULT'); $link = MenuTopLinks::get($link['id_linksmenutop'], $default_language, (int)Shop::getContextShopID()); $html .= ''; } From 2f088c4ac33b35f183179499af0f256116c4cc42 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Wed, 4 Dec 2013 16:06:42 +0100 Subject: [PATCH 06/14] [*] BO : changed dashgoals system --- modules/dashgoals/dashgoals.php | 125 ++++++++++++++++++------ modules/dashgoals/views/js/dashgoals.js | 5 +- 2 files changed, 99 insertions(+), 31 deletions(-) diff --git a/modules/dashgoals/dashgoals.php b/modules/dashgoals/dashgoals.php index d412a0614..ab25dd934 100644 --- a/modules/dashgoals/dashgoals.php +++ b/modules/dashgoals/dashgoals.php @@ -149,45 +149,110 @@ class Dashgoals extends Module public function getChartData($year) { + // Retrieve gross data from AdminStatsController $visits = AdminStatsController::getVisits(false, $year.date('-01-01'), $year.date('-12-31'), 'month'); $orders = AdminStatsController::getOrders($year.date('-01-01'), $year.date('-12-31'), 'month'); $sales = AdminStatsController::getTotalSales($year.date('-01-01'), $year.date('-12-31'), 'month'); - $stream1 = array('key' => $this->l('Traffic'), 'values' => array(), 'disabled' => true); - $stream2 = array('key' => $this->l('Conversion Rate'), 'values' => array()); - $stream3 = array('key' => $this->l('Average Cart Value'), 'values' => array()); - $stream4 = array('key' => $this->l('Sales'), 'values' => array()); + // There are stream types (different charts) and for each types there are 3 available zones (one color for the goal, one if you over perform and one if you under perfom) + $stream_types = array('traffic', 'conversion', 'avg_cart_value', 'sales'); + $stream_zones = array('real', 'more', 'less'); + // We initialize all the streams types for all the zones + $streams = array(); + $average_goals = array(); + foreach ($stream_types as $stream_type) + { + $streams[$stream_type] = array(); + foreach ($stream_zones as $stream_zone) + $streams[$stream_type][$stream_zone] = array( + 'key' => $stream_type.'_'.$stream_zone, + 'color' => ($stream_zone == 'more' ? '#333333' : ($stream_zone == 'less' ? '#DDDDDD' : '#999999')), + 'values' => array(), + 'disabled' => $stream_type == 'sales' ? false : true + ); + + $average_goals[$stream_type] = 0; + } + + // We need to calculate the average value of each goals for the year, this will be the base rate for "100%" + for ($i = '01'; $i <= 12; $i = sprintf('%02d', $i + 1)) + { + $average_goals['traffic'] += ConfigurationKPI::get('DASHGOALS_TRAFFIC_'.$i.'_'.$year); + $average_goals['conversion'] += ConfigurationKPI::get('DASHGOALS_CONVERSION_'.$i.'_'.$year) / 100; + $average_goals['avg_cart_value'] += ConfigurationKPI::get('DASHGOALS_AVG_CART_VALUE_'.$i.'_'.$year); + } + foreach ($average_goals as &$average_goal) + $average_goal /= 12; + $average_goals['sales'] = $average_goals['traffic'] * $average_goals['conversion'] * $average_goals['avg_cart_value']; + + // Now we can calculate the value for every months for ($i = '01'; $i <= 12; $i = sprintf('%02d', $i + 1)) { $timestamp = strtotime($year.'-'.$i.'-01'); - - $goal = ConfigurationKPI::get(strtoupper('dashgoals_traffic_'.$i.'_'.$year)); - $value = 0; - if ($goal && isset($visits[$timestamp])) - $value = round($visits[$timestamp] / $goal, 2); - $stream1['values'][] = array('x' => Dashgoals::$month_labels[$i], 'y' => $value); - $goal = ConfigurationKPI::get(strtoupper('dashgoals_conversion_'.$i.'_'.$year)); - $value = 0; - if ($goal && isset($visits[$timestamp]) && $visits[$timestamp] && isset($orders[$timestamp]) && $orders[$timestamp]) - $value = round((100 * $orders[$timestamp] / $visits[$timestamp]) / $goal, 2); - $stream2['values'][] = array('x' => Dashgoals::$month_labels[$i], 'y' => $value); - - $goal = ConfigurationKPI::get(strtoupper('dashgoals_avg_cart_value_'.$i.'_'.$year)); - $value = 0; - if ($goal && isset($orders[$timestamp]) && $orders[$timestamp] && isset($sales[$timestamp]) && $sales[$timestamp]) - $value = round(($sales[$timestamp] / $orders[$timestamp]) / $goal, 2); - $stream3['values'][] = array('x' => Dashgoals::$month_labels[$i], 'y' => $value); - - $goal = ConfigurationKPI::get(strtoupper('dashgoals_traffic_'.$i.'_'.$year)) - * ConfigurationKPI::get(strtoupper('dashgoals_conversion_'.$i.'_'.$year)) / 100 - * ConfigurationKPI::get(strtoupper('dashgoals_avg_cart_value_'.$i.'_'.$year)); - $value = 0; - if ($goal && isset($sales[$timestamp]) && $sales[$timestamp]) - $value = round($sales[$timestamp] / $goal, 2); - $stream4['values'][] = array('x' => Dashgoals::$month_labels[$i], 'y' => $value); + $month_goal = ConfigurationKPI::get('DASHGOALS_TRAFFIC_'.$i.'_'.$year); + $value = (isset($visits[$timestamp]) ? $visits[$timestamp] : 0); + $stream_values = $this->getValuesFromGoals($average_goals['traffic'], $month_goal, $value, Dashgoals::$month_labels[$i]); + foreach ($stream_zones as $stream_zone) + $streams['traffic'][$stream_zone]['values'][] = $stream_values[$stream_zone]; + + $month_goal = ConfigurationKPI::get('DASHGOALS_CONVERSION_'.$i.'_'.$year); + $value = 100 * ((isset($visits[$timestamp]) && $visits[$timestamp]) ? ($orders[$timestamp] / $visits[$timestamp]) : 0); + $stream_values = $this->getValuesFromGoals($average_goals['conversion'], $month_goal, $value, Dashgoals::$month_labels[$i]); + foreach ($stream_zones as $stream_zone) + $streams['conversion'][$stream_zone]['values'][] = $stream_values[$stream_zone]; + + $month_goal = ConfigurationKPI::get('DASHGOALS_AVG_CART_VALUE_'.$i.'_'.$year); + $value = ((isset($orders[$timestamp]) && $orders[$timestamp]) ? ($sales[$timestamp] / $orders[$timestamp]) : 0); + $stream_values = $this->getValuesFromGoals($average_goals['avg_cart_value'], $month_goal, $value, Dashgoals::$month_labels[$i]); + foreach ($stream_zones as $stream_zone) + $streams['avg_cart_value'][$stream_zone]['values'][] = $stream_values[$stream_zone]; + + $month_goal = ConfigurationKPI::get('DASHGOALS_TRAFFIC_'.$i.'_'.$year) * ConfigurationKPI::get('DASHGOALS_CONVERSION_'.$i.'_'.$year) / 100 * ConfigurationKPI::get('DASHGOALS_AVG_CART_VALUE_'.$i.'_'.$year); + $stream_values = $this->getValuesFromGoals($average_goals['sales'], $month_goal, isset($sales[$timestamp]) ? $sales[$timestamp] : 0, Dashgoals::$month_labels[$i]); + foreach ($stream_zones as $stream_zone) + $streams['sales'][$stream_zone]['values'][] = $stream_values[$stream_zone]; } - return array('chart_type' => 'bar_chart_goals', 'data' => array($stream1, $stream2, $stream3, $stream4)); + + // Merge all the streams before sending + $all_streams = array(); + foreach ($stream_types as $stream_type) + foreach ($stream_zones as $stream_zone) + $all_streams[] = $streams[$stream_type][$stream_zone]; + + return array('chart_type' => 'bar_chart_goals', 'data' => $all_streams); + } + + protected function getValuesFromGoals($average_goal, $month_goal, $value, $label) + { + // Initialize value for each zone + $stream_values = array('real' => array('x' => $label, 'y' => 0), 'less' => array('x' => $label, 'y' => 0), 'more' => array('x' => $label, 'y' => 0)); + + // Calculate the percentage of fullfilment of the goal + $fullfilment = 0; + if ($value && $month_goal) + $fullfilment = round($value / $month_goal, 2); + + // Base rate is essential here : it determines the value of the goal compared to the "100%" of the chart legend + $base_rate = $month_goal / $average_goal; + + // Fullfilment of 1 means that we performed exactly anticipated + if ($fullfilment == 1) + $stream_values['real'] = array('x' => $label, 'y' => $base_rate); + // Fullfilment lower than 1 means that we UNDER performed + elseif ($fullfilment < 1) // + { + $stream_values['real'] = array('x' => $label, 'y' => $fullfilment * $base_rate); + $stream_values['less'] = array('x' => $label, 'y' => $base_rate - ($fullfilment * $base_rate)); + } + // Fullfilment greater than 1 means that we OVER performed + elseif ($fullfilment > 1) + { + $stream_values['real'] = array('x' => $label, 'y' => $base_rate); + $stream_values['more'] = array('x' => $label, 'y' => ($fullfilment * $base_rate) - $base_rate); + } + + return $stream_values; } } \ No newline at end of file diff --git a/modules/dashgoals/views/js/dashgoals.js b/modules/dashgoals/views/js/dashgoals.js index d01a2209b..8168c4b27 100644 --- a/modules/dashgoals/views/js/dashgoals.js +++ b/modules/dashgoals/views/js/dashgoals.js @@ -2,10 +2,13 @@ function bar_chart_goals(widget_name, chart_details) { nv.addGraph(function() { var chart = nv.models.multiBarChart() - .stacked(false) + .stacked(true) .showControls(false) .tooltipContent(function(key, y, e, graph) { var perf = parseInt(e) - 100; + + return '/modules/dashgoals/views/js/dashgoals.js : Deprecated, now we need to retrieve the content with ajax'; + if (perf > 0) return '
' + key + '
+' + perf + '%
'; else if (perf < 0) From 33b5327b4db66390af57600f7d9899fe1a5ff953 Mon Sep 17 00:00:00 2001 From: Kevin Granger Date: Wed, 4 Dec 2013 16:58:34 +0100 Subject: [PATCH 07/14] // 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} {/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 @@
- {l s='Features:'} - -
- -
-
- - {$product->name|escape:html:'UTF-8'} - - {if isset($product->show_price) && $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} - {if $product->on_sale} -
{l s='Sale!'}
- {/if} - {/if} -
+
+ +
+
+ + {$product->name|escape:html:'UTF-8'} + + {if isset($product->show_price) && $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} + {if $product->on_sale} +
{l s='Sale!'}
+ {/if} + {/if} +
{$product->name|truncate:45:'...'|escape:'html':'UTF-8'}
-
+
{if isset($product->show_price) && $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} {convertPrice price=$product->getPrice($taxes_behavior)} {if isset($product->specificPrice) && $product->specificPrice} - {if {$product->specificPrice.reduction_type == 'percentage'}} - {displayWtPrice p=$product->getPrice($taxes_behavior)+($product->getPrice($taxes_behavior)* $product->specificPrice.reduction)} - -{$product->specificPrice.reduction*100|floatval}% - {else} - {convertPrice price=($product->getPrice($taxes_behavior) + $product->specificPrice.reduction)} - -{convertPrice price=$product->specificPrice.reduction} - {/if} - {/if} + {if {$product->specificPrice.reduction_type == 'percentage'}} + {displayWtPrice p=$product->getPrice($taxes_behavior)+($product->getPrice($taxes_behavior)* $product->specificPrice.reduction)} + -{$product->specificPrice.reduction*100|floatval}% + {else} + {convertPrice price=($product->getPrice($taxes_behavior) + $product->specificPrice.reduction)} + -{convertPrice price=$product->specificPrice.reduction} + {/if} + {/if} {if $product->on_sale} {elseif $product->specificPrice AND $product->specificPrice.reduction} -
- {l s='Reduced price!'} -
+
+ {l s='Reduced price!'} +
{/if} {if !empty($product->unity) && $product->unit_price_ratio > 0.000000} @@ -108,22 +108,28 @@ {/if}

-
-
- {if (!$product->hasAttributes() OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product->minimal_quantity == 1 AND $product->customizable != 2 AND !$PS_CATALOG_MODE} - {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'} - {else} - {l s='Add to cart'} - {/if} - {else} - - {/if} - {l s='View'} -
-
- -
+
+
+ {if (!$product->hasAttributes() OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product->minimal_quantity == 1 AND $product->customizable != 2 AND !$PS_CATALOG_MODE} + {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'} + + {else} + {l s='Add to cart'} + {/if} + {else} + + {/if} + {l s='View'} +
+
+ +
- +
@@ -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 08/14] // 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 09/14] [-] 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} -