From fd4006bcd43b20c08043ec6d9faa4e2d9355e220 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Fri, 5 Apr 2013 10:54:04 +0200
Subject: [PATCH 01/23] [-] MO: Fix product cover image on blockviewed with
multishop
---
modules/blockviewed/blockviewed.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/blockviewed/blockviewed.php b/modules/blockviewed/blockviewed.php
index d7cd1aed0..0ea240300 100644
--- a/modules/blockviewed/blockviewed.php
+++ b/modules/blockviewed/blockviewed.php
@@ -103,16 +103,16 @@ class BlockViewed extends Module
$productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT image_shop.id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite
FROM '._DB_PREFIX_.'product p
- LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')
- LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.
- Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
- LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image)
'.Shop::addSqlAssociation('product', 'p').'
+ LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')
+ LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'.
+ Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
+ LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image)
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')
WHERE p.id_product IN ('.$productIds.')
- AND (i.id_image IS NULL OR image_shop.id_shop='.(int)$this->context->shop->id.')
AND pl.id_lang = '.(int)($params['cookie']->id_lang).'
- AND cl.id_lang = '.(int)($params['cookie']->id_lang)
+ AND cl.id_lang = '.(int)($params['cookie']->id_lang).'
+ GROUP BY product_shop.id_product'
);
$productsImagesArray = array();
From d19cfc33bc575ee4bd93c85ea1e0193e8141ec89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Fri, 5 Apr 2013 11:29:30 +0200
Subject: [PATCH 02/23] [-] FO: Don't display vat_number field if not required
for the country on address.tpl
---
themes/default/address.tpl | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/themes/default/address.tpl b/themes/default/address.tpl
index bdc915c3d..f193fec91 100644
--- a/themes/default/address.tpl
+++ b/themes/default/address.tpl
@@ -102,14 +102,16 @@ $(function(){ldelim}
-
-
-
-
-
-
+ {/if}
+ {if $field_name eq 'vat_number'}
+
+
+
+
+
+
+
-
{/if}
{if $field_name eq 'firstname'}
From 3bbb9aa68579d3b62218a0d409b80f49dbc1a758 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Fri, 5 Apr 2013 11:44:16 +0200
Subject: [PATCH 03/23] [*] FO: use subdirectory per template for smarty cache
---
config/smarty.config.inc.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/config/smarty.config.inc.php b/config/smarty.config.inc.php
index f45ce627d..128900a6d 100644
--- a/config/smarty.config.inc.php
+++ b/config/smarty.config.inc.php
@@ -32,6 +32,8 @@ global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(_PS_CACHE_DIR_.'smarty/compile');
$smarty->setCacheDir(_PS_CACHE_DIR_.'smarty/cache');
+if (!Tools::getSafeModeStatus())
+ $smarty->use_sub_dirs = true;
$smarty->setConfigDir(_PS_SMARTY_DIR_.'configs');
$smarty->caching = false;
$smarty->force_compile = (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_FORCE_COMPILE_) ? true : false;
From 26bdf77308282952b951f1138785dbd9431302d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Fri, 5 Apr 2013 11:57:52 +0200
Subject: [PATCH 04/23] // And now use smarty cache groups for cache ids to be
more efficient
---
classes/module/Module.php | 2 +-
modules/blockcategories/blockcategories.php | 2 +-
modules/blocksearch/blocksearch.php | 2 +-
modules/blocktopmenu/blocktopmenu.php | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/classes/module/Module.php b/classes/module/Module.php
index 3037a56a8..e42b12fdb 100644
--- a/classes/module/Module.php
+++ b/classes/module/Module.php
@@ -1595,7 +1595,7 @@ abstract class ModuleCore
{
if ($name === null)
$name = $this->name;
- return $name.'|'.(int)$this->context->shop->id.'_'.(int)Group::getCurrent()->id.'_'.(int)$this->context->language->id;
+ return $name.'|'.(int)$this->context->shop->id.'|'.(int)Group::getCurrent()->id.'|'.(int)$this->context->language->id;
}
public function display($file, $template, $cacheId = null, $compileId = null)
diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php
index 60df5c858..767ad74f0 100644
--- a/modules/blockcategories/blockcategories.php
+++ b/modules/blockcategories/blockcategories.php
@@ -227,7 +227,7 @@ class BlockCategories extends Module
$id_product = (int)Tools::getValue('id_product', 0);
$id_category = (int)Tools::getValue('id_category', 0);
$id_lang = (int)$this->context->language->id;
- return 'blockcategories|'.$this->context->shop->id.'_'.$groups.'_'.$id_lang.'_'.$id_product.'_'.$id_category;
+ return 'blockcategories|'.$this->context->shop->id.'|'.$groups.'|'.$id_lang.'|'.$id_product.'|'.$id_category;
}
public function hookFooter($params)
diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php
index 496c93753..1df62a660 100644
--- a/modules/blocksearch/blocksearch.php
+++ b/modules/blocksearch/blocksearch.php
@@ -121,7 +121,7 @@ public function hookDisplayMobileHeader($params)
protected function getCacheId($name = null)
{
$cache_id = parent::getCacheId($name);
- return $cache_id.'_'.(int)Tools::usingSecureMode();
+ return $cache_id.'|'.(int)Tools::usingSecureMode();
}
}
diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php
index eff8627f3..25f34e570 100644
--- a/modules/blocktopmenu/blocktopmenu.php
+++ b/modules/blocktopmenu/blocktopmenu.php
@@ -717,7 +717,7 @@ class Blocktopmenu extends Module
{
parent::getCacheId($name);
$page_name = in_array($this->page_name, array('category', 'supplier', 'manufacturer', 'cms', 'product')) ? $this->page_name : 'index';
- return 'blocktopmenu|'.$page_name.'-'.(int)$this->context->shop->id.'-'.implode(', ',$this->user_groups).'-'.(int)$this->context->language->id.'-'.(int)Tools::getValue('id_category').'-'.(int)Tools::getValue('id_manufacturer').'-'.(int)Tools::getValue('id_supplier').'-'.(int)Tools::getValue('id_cms').'-'.(int)Tools::getValue('id_product');
+ return 'blocktopmenu|'.$page_name.'|'.(int)$this->context->shop->id.'|'.implode(', ',$this->user_groups).'|'.(int)$this->context->language->id.'|'.(int)Tools::getValue('id_category').'|'.(int)Tools::getValue('id_manufacturer').'|'.(int)Tools::getValue('id_supplier').'|'.(int)Tools::getValue('id_cms').'|'.(int)Tools::getValue('id_product');
}
public function hookDisplayTop($param)
From d7b78e6f436a44e0986af9d97ed03b3b75446315 Mon Sep 17 00:00:00 2001
From: Damien Metzger
Date: Fri, 5 Apr 2013 14:32:49 +0200
Subject: [PATCH 05/23] // Fixed commit
a53163feee5e0235b8f260c4b241cdce7b7e00f9 (shipping discount in the invoice)
---
pdf/invoice.tpl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pdf/invoice.tpl b/pdf/invoice.tpl
index b2950c86a..13a68ac67 100755
--- a/pdf/invoice.tpl
+++ b/pdf/invoice.tpl
@@ -190,7 +190,10 @@
{assign var="shipping_discount_tax_incl" value="0"}
{foreach $cart_rules as $cart_rule}
- {cycle values='#FFF,#DDD' assign=bgcolor}
+ {if $cart_rule.free_shipping}
+ {assign var="shipping_discount_tax_incl" value=$order_invoice->total_shipping_tax_incl}
+ {/if}
+ {cycle values='#FFF,#DDD' assign=bgcolor}
| {$cart_rule.name} |
From 6edc6c37f7d92efcf0768ecc08546c0ca1124f5b Mon Sep 17 00:00:00 2001
From: vAugagneur
Date: Fri, 5 Apr 2013 17:14:38 +0200
Subject: [PATCH 06/23] //small fix
---
install-dev/theme/views/process.phtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install-dev/theme/views/process.phtml b/install-dev/theme/views/process.phtml
index 67b1e4320..3383edae2 100644
--- a/install-dev/theme/views/process.phtml
+++ b/install-dev/theme/views/process.phtml
@@ -75,7 +75,7 @@ var process_steps = process_steps) ?>;
- |