From 5eb63feecc748e1f968210989b5e2b22398d0df9 Mon Sep 17 00:00:00 2001 From: ldecoker Date: Fri, 8 Feb 2013 11:37:14 +0100 Subject: [PATCH 01/32] Update modules/blocksupplier/blocksupplier.php Missing uninstall function for blocksupplier to clean the configuration table. --- modules/blocksupplier/blocksupplier.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/blocksupplier/blocksupplier.php b/modules/blocksupplier/blocksupplier.php index eaaae1314..4eb395e12 100644 --- a/modules/blocksupplier/blocksupplier.php +++ b/modules/blocksupplier/blocksupplier.php @@ -57,6 +57,19 @@ class BlockSupplier extends Module return true; } + public function uninstall() + { + if (!parent::uninstall()) + return false; + + /* remove the configuration variable */ + $result = Configuration::deleteByName('SUPPLIER_DISPLAY_TEXT'); + $result &= Configuration::deleteByName('SUPPLIER_DISPLAY_TEXT_NB'); + $result &= Configuration::deleteByName('SUPPLIER_DISPLAY_FORM'); + + return $result; + } + function hookDisplayLeftColumn($params) { $id_lang = (int)Context::getContext()->language->id; From 5f902ada8c1228b32dbc84c88e5c2b56992faa17 Mon Sep 17 00:00:00 2001 From: minic studio Date: Fri, 1 Mar 2013 19:04:21 +0200 Subject: [PATCH 02/32] [*] MO : blocksearch - override buttons for ajax cart When instant search is in use buttons need override after load so the ajax functionality works --- modules/blocksearch/blocksearch-instantsearch.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/blocksearch/blocksearch-instantsearch.tpl b/modules/blocksearch/blocksearch-instantsearch.tpl index ad933b7bd..53163f296 100644 --- a/modules/blocksearch/blocksearch-instantsearch.tpl +++ b/modules/blocksearch/blocksearch-instantsearch.tpl @@ -38,6 +38,8 @@ $('#center_column').attr('id', 'old_center_column'); $('#old_center_column').after('
'+data+'
'); $('#old_center_column').hide(); + // Button override + ajaxCart.overrideButtonsInThePage(); $("#instant_search_results a.close").click(function() { $("#search_query_{$blocksearch_type}").val(''); return tryToCloseInstantSearch(); From 9d718bc0a68b1fa238b287cff1d7a00cd49cf628 Mon Sep 17 00:00:00 2001 From: Patanock Date: Thu, 7 Mar 2013 10:42:27 +0100 Subject: [PATCH 03/32] Update AdminOrdersController.php --- controllers/admin/AdminOrdersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index f27be6b4e..29cd29a01 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -308,7 +308,7 @@ class AdminOrdersControllerCore extends AdminController $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop)) { - Hook::exec('actionAdminOrdersTrackingNumberUpdate', array('order' => $order)); + Hook::exec('actionAdminOrdersTrackingNumberUpdate', array('customer' => $customer, 'order' => $order, 'carrier' => $carrier)); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else From e725a42f5eadf15f22f1c40356fc4b1167fc560c Mon Sep 17 00:00:00 2001 From: Patanock Date: Thu, 7 Mar 2013 10:47:12 +0100 Subject: [PATCH 04/32] Update AdminOrdersController.php --- controllers/admin/AdminOrdersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 29cd29a01..67eab2432 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -308,7 +308,7 @@ class AdminOrdersControllerCore extends AdminController $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop)) { - Hook::exec('actionAdminOrdersTrackingNumberUpdate', array('customer' => $customer, 'order' => $order, 'carrier' => $carrier)); + Hook::exec('actionAdminOrdersTrackingNumberUpdate', array('order' => $order, 'customer' => $customer, 'carrier' => $carrier)); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else From 29cc8fc78280432be26d9743fc2c333f24e6b399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=C3=BFSs=27?= Date: Mon, 18 Mar 2013 17:05:22 +0100 Subject: [PATCH 05/32] [-] FO: CMS link to conditions should not be in SSL --- controllers/front/OrderOpcController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 53e379b6d..215367b8d 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -483,7 +483,7 @@ class OrderOpcControllerCore extends ParentOrderController $address_delivery = new Address($this->context->cart->id_address_delivery); $cms = new CMS(Configuration::get('PS_CONDITIONS_CMS_ID'), $this->context->language->id); - $link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, true); + $link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite); if (!strpos($link_conditions, '?')) $link_conditions .= '?content_only=1'; else From 6a278d405d16c4b371698ccfae05019a17b6fbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=C3=BFSs=27?= Date: Mon, 18 Mar 2013 17:07:41 +0100 Subject: [PATCH 06/32] [-] FO: CMS link to conditions should not be in SSL --- controllers/front/ParentOrderController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/ParentOrderController.php b/controllers/front/ParentOrderController.php index 164ba87b2..97663a574 100644 --- a/controllers/front/ParentOrderController.php +++ b/controllers/front/ParentOrderController.php @@ -492,7 +492,7 @@ class ParentOrderControllerCore extends FrontController // TOS $cms = new CMS(Configuration::get('PS_CONDITIONS_CMS_ID'), $this->context->language->id); - $this->link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, false); + $this->link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite); if (!strpos($this->link_conditions, '?')) $this->link_conditions .= '?content_only=1'; else From 5b13f6aa7e0e0cfb884df24afd31ec56f27e47af Mon Sep 17 00:00:00 2001 From: ccauw Date: Tue, 16 Apr 2013 16:09:26 +0300 Subject: [PATCH 07/32] [*] BO : Add block "override_form_extra" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add block "override_form_extra" in list_header.tpl {if !$simple_header}
{block name="override_form_extra"}{/block} In AdminXxxxController, If we display list which are filtered by "variable" like index.php?controller=AdminXxxx&variable=val&token=... When using pagination or columns filters, the controller is called without our variable. There are two methods to retrieve our variable: cookie or form Post. To use the second opportunity, we need to put hidden input "variable" in the form. So we need à block in the form to override. --- admin-dev/themes/default/template/helpers/list/list_header.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin-dev/themes/default/template/helpers/list/list_header.tpl b/admin-dev/themes/default/template/helpers/list/list_header.tpl index 1a821e4f6..b8df4bd49 100644 --- a/admin-dev/themes/default/template/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_header.tpl @@ -80,6 +80,9 @@ {if !$simple_header} + + {block name="override_form_extra"}{/block} + {/if} From 1a814619655368eb13a7cf5637347795ff45b53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20B=C3=A9lorgey?= Date: Sun, 28 Apr 2013 11:13:46 +0200 Subject: [PATCH 08/32] Replacing the default pinkish background with a grey one, and put the text in {color} --- mails/en/order_conf.html | 4 ++-- modules/mailalerts/mails/en/new_order.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html index b3b54eeb8..bd5b679e8 100644 --- a/mails/en/order_conf.html +++ b/mails/en/order_conf.html @@ -72,8 +72,8 @@ - - + +
 Total paid{total_paid}Total paid{total_paid}
diff --git a/modules/mailalerts/mails/en/new_order.html b/modules/mailalerts/mails/en/new_order.html index 9a77933e0..5767db53b 100644 --- a/modules/mailalerts/mails/en/new_order.html +++ b/modules/mailalerts/mails/en/new_order.html @@ -43,8 +43,8 @@ {total_shipping} - Total paid - {total_paid} + Total paid + {total_paid} From 0fed37eecdfc623ed1eb651913ba0064cf7ffe13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20B=C3=A9lorgey?= Date: Mon, 29 Apr 2013 10:21:53 +0200 Subject: [PATCH 09/32] [*] Mails : delete a hard-coded pink background --- mails/en/order_conf.html | 6 +++--- modules/mailalerts/mails/en/new_order.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html index bd5b679e8..a3ec03b01 100644 --- a/mails/en/order_conf.html +++ b/mails/en/order_conf.html @@ -72,8 +72,8 @@   -Total paid -{total_paid} +Total paid +{total_paid} @@ -125,4 +125,4 @@ - \ No newline at end of file + diff --git a/modules/mailalerts/mails/en/new_order.html b/modules/mailalerts/mails/en/new_order.html index 5767db53b..7bf9063f8 100644 --- a/modules/mailalerts/mails/en/new_order.html +++ b/modules/mailalerts/mails/en/new_order.html @@ -43,8 +43,8 @@ {total_shipping} - Total paid - {total_paid} + Total paid + {total_paid} @@ -68,4 +68,4 @@ - \ No newline at end of file + From 903b17979c04eaff723280c6117878d6185660eb Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 10:47:19 +0200 Subject: [PATCH 10/32] [-] BO : fixed error message in language form #PSCFV-8890 --- classes/Validate.php | 9 ++++++--- .../admin/AdminLanguagesController.php | 19 +++++++++---------- css/admin.css | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/classes/Validate.php b/classes/Validate.php index 84d8bc24e..6af8d92c2 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -1055,6 +1055,9 @@ class ValidateCore { return (bool)(is_string($name) && preg_match('/^[0-9a-zA-Z-_]*$/u', $name)); } - -} - + + public static function isPrestaShopVersion($version) + { + return (preg_match('/^[0-1]\.[0-9]{1,2}(\.[0-9]{1,2}){0,2}$/', $version) && ip2long($version)); + } +} \ No newline at end of file diff --git a/controllers/admin/AdminLanguagesController.php b/controllers/admin/AdminLanguagesController.php index 9a00c8ca0..1db3d4eeb 100644 --- a/controllers/admin/AdminLanguagesController.php +++ b/controllers/admin/AdminLanguagesController.php @@ -475,19 +475,21 @@ class AdminLanguagesControllerCore extends AdminController public function ajaxProcessCheckLangPack() { $this->json = true; - if (empty($_GET['iso_lang'])) + if (!Tools::getValue('iso_lang') || !Validate::isLanguageIsoCode(Tools::getValue('iso_lang'))) { $this->status = 'error'; - $this->errors[] = '[TECHNICAL ERROR] iso_lang not set or empty'; + $this->errors[] = $this->l('Iso code is not valid'); + return; } - if (empty($_GET['ps_version'])) + if (!Tools::getValue('ps_version') || !Validate::isPrestaShopVersion(Tools::getValue('ps_version'))) { $this->status = 'error'; - $this->errors[] = '[TECHNICAL ERROR] ps_version not set or empty'; + $this->errors[] = $this->l('Technical Error: ps_version is not valid'); + return; } // Get all iso code available - if($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang'])) + if ($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.Tools::getValue('ps_version').'&iso_lang='.Tools::getValue('iso_lang'))) { $result = Tools::jsonDecode($lang_packs); if ($lang_packs !== '' && $result && !isset($result->error)) @@ -498,16 +500,13 @@ class AdminLanguagesControllerCore extends AdminController else { $this->status = 'error'; - $msg = $this->l('Wrong ISO code, or the selected language pack is unavailable.'); - if ($result) - $msg = $result->msg; - $this->errors[] = $msg; + $this->errors[] = $this->l('Wrong ISO code, or the selected language pack is unavailable.'); } } else { $this->status = 'error'; - $this->errors[] = '[TECHNICAL ERROR] Server unreachable'; + $this->errors[] = $this->l('Technical Error: translation server unreachable'); } } diff --git a/css/admin.css b/css/admin.css index 4ee837e91..ec73d1414 100644 --- a/css/admin.css +++ b/css/admin.css @@ -498,7 +498,7 @@ select optgroup option { background: #FFBABA url(../img/admin/icon-cancel.png) no-repeat scroll 6px 6px; border: 1px solid #CC0000; color:#D8000C; - padding:20px; + padding:20px 40px; position:fixed; bottom:0; width:100%; From a06b42704ec67ca4230415e31abea71b76790a9f Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 10:52:44 +0200 Subject: [PATCH 11/32] [-] FO : fixed truncate and entities in the cart block #PSCFV-8870 --- modules/blockcart/blockcart-json.tpl | 2 +- modules/blockcart/blockcart.tpl | 2 +- themes/default/modules/blockcart/blockcart.tpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/blockcart/blockcart-json.tpl b/modules/blockcart/blockcart-json.tpl index 6311433af..68ccf81d2 100644 --- a/modules/blockcart/blockcart-json.tpl +++ b/modules/blockcart/blockcart-json.tpl @@ -33,7 +33,7 @@ "link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|addslashes|replace:'\\\'':'\''}", "quantity": {$product.cart_quantity}, "priceByLine": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}", - "name": "{$product.name|html_entity_decode:2:'UTF-8'|escape:'htmlall'|truncate:15:'...':true}", + "name": "{$product.name|html_entity_decode:2:'UTF-8'|truncate:15:'...':true|escape:'htmlall'}", "price": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}", "price_float": "{$product.total}", "idCombination": {if isset($product.attributes_small)}{$productAttributeId}{else}0{/if}, diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl index 051bcf39e..d33a601c3 100644 --- a/modules/blockcart/blockcart.tpl +++ b/modules/blockcart/blockcart.tpl @@ -100,7 +100,7 @@ var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
  • {$customization.quantity}x{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)} - {$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|escape:html:'UTF-8'|replace:"
    ":" "|truncate:28} + {$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"
    ":" "|truncate:28:'...'|escape:html:'UTF-8'} {else} {l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'} {/if} diff --git a/themes/default/modules/blockcart/blockcart.tpl b/themes/default/modules/blockcart/blockcart.tpl index 287510b41..d273fb881 100644 --- a/themes/default/modules/blockcart/blockcart.tpl +++ b/themes/default/modules/blockcart/blockcart.tpl @@ -100,7 +100,7 @@ var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
  • {$customization.quantity}x{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)} - {$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|escape:html:'UTF-8'|replace:"
    ":" "|truncate:28} + {$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"
    ":" "|truncate:28:'...'|escape:html:'UTF-8'} {else} {l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'} {/if} From c587934e258241eec5a3bc2bbd6581a8a3dd5ce6 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 11:16:26 +0200 Subject: [PATCH 12/32] [-] BO : fixed automatic creation of email overrides in the template #PSCFV-8785 --- controllers/admin/AdminTranslationsController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 9b360eb8b..66dc641f0 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -1454,6 +1454,8 @@ class AdminTranslationsControllerCore extends AdminController $path = $arr_mail_path[$group_name]; if ($module_name) $path = str_replace('{module}', $module_name, $path); + if (!file_exists($path) && !mkdir($path, 0777, true)) + throw new PrestaShopException(sprintf(Tools::displayError('Directory "%s" cannot be created'), dirname($file_path))); file_put_contents($path.$mail_name.'.'.$type_content, $content); } else From 3b5591dc55b7550614fd8b45e2bfe7c931784762 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 11:35:47 +0200 Subject: [PATCH 13/32] [-] FO : removed misleading label on the shipping total #PSCFV-8556 --- themes/default/order-payment.tpl | 2 +- themes/default/shopping-cart.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/default/order-payment.tpl b/themes/default/order-payment.tpl index bde92b04f..db4482b2f 100644 --- a/themes/default/order-payment.tpl +++ b/themes/default/order-payment.tpl @@ -118,7 +118,7 @@ {l s='Free Shipping!'} {else} - {if $use_taxes} + {if $use_taxes && $total_shipping_tax_exc != $total_shipping} {if $priceDisplay} {if $display_tax_label}{l s='Total shipping (tax excl.)'}{else}{l s='Total shipping'}{/if} diff --git a/themes/default/shopping-cart.tpl b/themes/default/shopping-cart.tpl index 8b486c2de..cf3a8858a 100644 --- a/themes/default/shopping-cart.tpl +++ b/themes/default/shopping-cart.tpl @@ -126,7 +126,7 @@ {l s='Free Shipping!'} {else} - {if $use_taxes} + {if $use_taxes && $total_shipping_tax_exc != $total_shipping} {if $priceDisplay} {if $display_tax_label}{l s='Total shipping (tax excl.)'}{else}{l s='Total shipping'}{/if} From 527f87a691258cb4b3e27c609c14d6bc55711f8d Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 12:08:45 +0200 Subject: [PATCH 14/32] // Fixed directory creation in translation #PSCFV-8212 --- controllers/admin/AdminTranslationsController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 66dc641f0..7c4d18ce9 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -2455,6 +2455,9 @@ class AdminTranslationsControllerCore extends AdminController protected function writeSubjectTranslationFile($sub, $path) { + if (!Tools::file_exists_cache(dirname(path))) + if (!mkdir(dirname(path), 0700)) + throw new PrestaShopException('Directory '.dirname(path).' cannot be created.'); if ($fd = @fopen($path, 'w')) { $tab = 'LANGMAIL'; From dc7f1ceddf57cbccdf45395e46a75fe0b0f0e958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 29 Apr 2013 13:47:46 +0200 Subject: [PATCH 15/32] [-] BO: Fix #PSCFV-8957 order creation when id_cart=0 is present in database but should normally not happen --- controllers/admin/AdminCartsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index fc0cf91ce..e8ee17cef 100755 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -209,7 +209,7 @@ class AdminCartsControllerCore extends AdminController if (!$this->context->cart->id_customer) $this->context->cart->id_customer = $id_customer; - if ($this->context->cart->OrderExists()) + if (Validate::isLoadedObject($this->context->cart) && $this->context->cart->OrderExists()) return; if (!$this->context->cart->secure_key) $this->context->cart->secure_key = $this->context->customer->secure_key; From acccaf5fbc4ce05d82c7d1cffdb2702d6a8fb7db Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 29 Apr 2013 16:21:33 +0200 Subject: [PATCH 16/32] Merged Pull Request #242 - thanks @andskiba --- classes/Search.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/Search.php b/classes/Search.php index 1c9bbd68b..ca3414dd4 100644 --- a/classes/Search.php +++ b/classes/Search.php @@ -281,6 +281,8 @@ class SearchCore $alias = ''; if ($order_by == 'price') $alias = 'product_shop.'; + else if ($order_by == 'date_upd') + $alias = 'p.'; $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`, MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` manufacturer_name '.$score.', MAX(product_attribute_shop.`id_product_attribute`) id_product_attribute, From 9ce224988376b281641989996d6ed2c42eed7b75 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 29 Apr 2013 17:03:41 +0200 Subject: [PATCH 17/32] // revert from commit 5f6d0614df4bf7d354988dd7320d012238488401 --- themes/default/js/product.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 9ff798a8f..ad0069483 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -422,11 +422,9 @@ function displayImage(domAAroundImgThumb, no_animation) var newSrc = domAAroundImgThumb.attr('href').replace('thickbox', 'large'); if ($('#bigpic').attr('src') != newSrc) { - $(this).attr('src', newSrc).load(function() { - $(this).show(); - if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) - $(this).attr('alt', domAAroundImgThumb.attr('href')); - }); + $('#bigpic').attr('src', newSrc); + if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) + $('#bigpic').attr('rel', domAAroundImgThumb.attr('href')); } $('#views_block li a').removeClass('shown'); $(domAAroundImgThumb).addClass('shown'); From 78747eedc29c292be3c695d2a634109db241f117 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 29 Apr 2013 17:12:17 +0200 Subject: [PATCH 18/32] // rework of https://github.com/PrestaShop/PrestaShop/commit/5f6d0614df4bf7d354988dd7320d012238488401#commitcomment-3108107 --- themes/default/js/product.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index ad0069483..85982470a 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -422,9 +422,11 @@ function displayImage(domAAroundImgThumb, no_animation) var newSrc = domAAroundImgThumb.attr('href').replace('thickbox', 'large'); if ($('#bigpic').attr('src') != newSrc) { - $('#bigpic').attr('src', newSrc); + $('#bigpic').attr('src', newSrc).load(function() { + $(this).show(); if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) - $('#bigpic').attr('rel', domAAroundImgThumb.attr('href')); + $(this).attr('arel', domAAroundImgThumb.attr('href')); + }); } $('#views_block li a').removeClass('shown'); $(domAAroundImgThumb).addClass('shown'); From 88adba8e5b52fe3c9a775f7ab432da0fec929992 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 29 Apr 2013 17:19:07 +0200 Subject: [PATCH 19/32] // typo --- themes/default/js/product.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 85982470a..f0dff6b54 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -425,7 +425,7 @@ function displayImage(domAAroundImgThumb, no_animation) $('#bigpic').attr('src', newSrc).load(function() { $(this).show(); if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) - $(this).attr('arel', domAAroundImgThumb.attr('href')); + $(this).attr('rel', domAAroundImgThumb.attr('href')); }); } $('#views_block li a').removeClass('shown'); From 989b19d94a1545d0fc75d1fd2c733dd317cd7dcb Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 17:11:17 +0200 Subject: [PATCH 20/32] [-] BO : fixed image import with allow_url_fopen deactivated #PSCFV-8181 --- classes/Tools.php | 25 +++++++++++++++++++-- controllers/admin/AdminImportController.php | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 7617ddec1..30cff6c8a 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1313,9 +1313,30 @@ class ToolsCore { return @simplexml_load_string(Tools::file_get_contents($url), $class_name); } + + public static function copy($source, $destination, $stream_context = null) + { + if ($stream_context == null && preg_match('/^https?:\/\//', $source)) + $stream_context = @stream_context_create(array('http' => array('timeout' => 10))); - - public static $a = 0; + if (in_array(@ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\/\//', $source)) + return @copy($source, $destination, $stream_context); + elseif (function_exists('curl_init')) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_URL, $source); + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($curl, CURLOPT_TIMEOUT, 10); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); + $opts = stream_context_get_options($stream_context); + $content = curl_exec($curl); + curl_close($curl); + return file_put_contents($content, $destination); + } + else + return false; + } /** * @deprecated as of 1.5 use Media::minifyHTML() diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index 2bf3a7aa5..4caac1013 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -819,7 +819,7 @@ class AdminImportControllerCore extends AdminController // 'file_exists' doesn't work on distant file, and getimagesize make the import slower. // Just hide the warning, the traitment will be the same. - if (@copy($url, $tmpfile)) + if (Tools::copy($url, $tmpfile)) { ImageManager::resize($tmpfile, $path.'.jpg'); $images_types = ImageType::getImagesTypes($entity); From 4c259393f5f9b06031934513620769721c0e2b6c Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 17:45:29 +0200 Subject: [PATCH 21/32] // Fixed case which caused duplicated translation #PSCFV-8936 --- themes/default/guest-tracking.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/guest-tracking.tpl b/themes/default/guest-tracking.tpl index 68d151db0..030081797 100644 --- a/themes/default/guest-tracking.tpl +++ b/themes/default/guest-tracking.tpl @@ -23,7 +23,7 @@ * International Registered Trademark & Property of PrestaShop SA *} -{capture name=path}{l s='Guest tracking'}{/capture} +{capture name=path}{l s='Guest Tracking'}{/capture} {include file="./breadcrumb.tpl"}

    {l s='Guest Tracking'}

    From d00ccdf306839ab811817b1518b3674e2bc0b546 Mon Sep 17 00:00:00 2001 From: Dragan Skrbic Date: Mon, 29 Apr 2013 18:07:42 +0200 Subject: [PATCH 22/32] // Fixed image import --- classes/Tools.php | 2 +- controllers/admin/AdminImportController.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 30cff6c8a..925a5fc39 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1332,7 +1332,7 @@ class ToolsCore $opts = stream_context_get_options($stream_context); $content = curl_exec($curl); curl_close($curl); - return file_put_contents($content, $destination); + return file_put_contents($destination, $content); } else return false; diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index 4caac1013..81723c4fc 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -1433,9 +1433,7 @@ class AdminImportControllerCore extends AdminController $image->position = Image::getHighestPosition($product->id) + 1; $image->cover = (!$key && !$product_has_images) ? true : false; // file_exists doesn't work with HTTP protocol - if (@fopen($url, 'r') == false) - $error = true; - else if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true && + if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true && ($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add()) { // associate image to selected shops From 548ef7691aa6accc576171061db5e567e64ec1f6 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 29 Apr 2013 18:34:19 +0200 Subject: [PATCH 23/32] // BO : Changed product display on supplier page --- .../suppliers/helpers/view/view.tpl | 77 ++++++++----------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl index 8ce702b06..db49a35d2 100644 --- a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl @@ -30,55 +30,44 @@

    {$supplier->name}

    {l s='Number of products:'} {count($products)}

    + + + + + + + + + + {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} + {foreach $products AS $product} -
    {if !$product->hasAttributes()} -
    {l s='Product name'}{l s='Attribute name'}{l s='Supplier Reference'}{l s='Wholesale price'}{l s='Reference'}{l s='EAN13'}{l s='UPC'}{l s='Available Quantity'}
    - - - {if !empty($product->product_supplier_reference)}{/if} - {if !empty($product->product_supplier_price_te)}{/if} - {if !empty($product->reference)}{/if} - {if !empty($product->ean13)}{/if} - {if !empty($product->upc)}{/if} - {if $stock_management}{/if} - -
    {l s='Name'} {$product->name}{l s='Supplier Reference:'} {$product->product_supplier_reference}{l s='Wholesale price:'} {$product->product_supplier_price_te}{l s='Reference:'} {$product->reference}{l s='EAN13:'} {$product->ean13}{l s='UPC:'} {$product->upc}{l s='Available Quantity:'} {$product->quantity}
    + + {$product->name} + {l s='N/A'} + {if empty($product->product_supplier_reference)}{l s='N/A'}{else}{$product->product_supplier_reference}{/if} + {if empty($product->product_supplier_price_te)}{l s='N/A'}{else}{$product->product_supplier_price_te}{/if} + {if empty($product->reference)}{l s='N/A'}{else}{$product->reference}{/if} + {if empty($product->ean13)}{l s='N/A'}{else}{$product->ean13}{/if} + {if empty($product->upc)}{l s='N/A'}{else}{$product->upc}{/if} + {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{$product->quantity}{/if} + {else} -

    {$product->name}

    - - - - - - - - - - - - - - - - - - {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} + {foreach $product->combination AS $id_product_attribute => $product_attribute} + + + + + + + + + {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} - {foreach $product->combination AS $id_product_attribute => $product_attribute} - - - - - - - - {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} - - {/foreach} -
    {l s='Attribute name'}{l s='Supplier Reference'}{l s='Wholesale price'}{l s='Reference'}{l s='EAN13'}{l s='UPC'}{l s='Available Quantity'}
    {$product->name}{if empty($product_attribute.attributes)}{l s='N/A'}{else}{$product_attribute.attributes}{/if}{if empty($product_attribute.product_supplier_reference)}{l s='N/A'}{else}{$product_attribute.product_supplier_reference}{/if}{if empty($product_attribute.product_supplier_price_te)}{l s='N/A'}{else}{$product_attribute.product_supplier_price_te}{/if}{if empty($product_attribute.reference)}{l s='N/A'}{else}{$product_attribute.reference}{/if}{if empty($product_attribute.ean13)}{l s='N/A'}{else}{$product_attribute.ean13}{/if}{if empty($product_attribute.upc)}{l s='N/A'}{else}{$product_attribute.upc}{/if}{$product_attribute.quantity}
    {$product_attribute.attributes}{$product_attribute.product_supplier_reference}{$product_attribute.product_supplier_price_te}{$product_attribute.reference}{$product_attribute.ean13}{$product_attribute.upc}{$product_attribute.quantity}
    + {/foreach} {/if} {/foreach} - + {/block} From 9fc4bce500a30dcca8203d6ce0dc47611ce60796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 29 Apr 2013 18:49:42 +0200 Subject: [PATCH 24/32] [-] Core: Fix specific prices if they are configured to count quantity per product and not per combination --- classes/Product.php | 1 - 1 file changed, 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index 5eb9a0017..4c32d433f 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2476,7 +2476,6 @@ class ProductCore extends ObjectModel SELECT SUM(`quantity`) FROM `'._DB_PREFIX_.'cart_product` WHERE `id_product` = '.(int)$id_product.' - AND `id_product_attribute` = '.(int)$id_product_attribute.' AND `id_cart` = '.(int)$id_cart); $cart_quantity = self::$_cart_quantity[$cache_name]; } From a8698d9e59777ce811278cb169436cb5d629d5b9 Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Mon, 29 Apr 2013 21:54:26 +0200 Subject: [PATCH 25/32] [-] Bo : Admin login loop under Firefox --- classes/controller/AdminController.php | 4 +++- js/login.js | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 87f4d5ea7..b66e31688 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1760,7 +1760,9 @@ class AdminControllerCore extends Controller $this->context->employee->logout(); if ($this->controller_name != 'AdminLogin' && (!isset($this->context->employee) || !$this->context->employee->isLoggedBack())) - Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').(!isset($_GET['logout']) ? '&redirect='.$this->controller_name : '')); + { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').((!isset($_GET['logout']) && $this->controller_name != 'AdminNotFound') ? '&redirect='.$this->controller_name : '')); + } // Set current index $current_index = 'index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : ''); diff --git a/js/login.js b/js/login.js index 934e44261..0ca9bf5b1 100644 --- a/js/login.js +++ b/js/login.js @@ -75,11 +75,10 @@ function doAjaxLogin(redirect) { redirect: redirect }, success: function(jsonData) { - if (jsonData.hasErrors) { + if (jsonData.hasErrors) displayErrors(jsonData.errors); - } else { - window.location.href = jsonData.redirect; - } + else + window.location.assign(jsonData.redirect); }, error: function(XMLHttpRequest, textStatus, errorThrown) { $('#error').html('

    TECHNICAL ERROR:

    Details: Error thrown: ' + XMLHttpRequest + '

    Text status: ' + textStatus + '

    ').show(); From d618c8618a7a44518a7c6649949ed0582392f4d6 Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Mon, 29 Apr 2013 21:55:30 +0200 Subject: [PATCH 26/32] //norms --- classes/controller/AdminController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index b66e31688..bd413b9d0 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1760,9 +1760,7 @@ class AdminControllerCore extends Controller $this->context->employee->logout(); if ($this->controller_name != 'AdminLogin' && (!isset($this->context->employee) || !$this->context->employee->isLoggedBack())) - { Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').((!isset($_GET['logout']) && $this->controller_name != 'AdminNotFound') ? '&redirect='.$this->controller_name : '')); - } // Set current index $current_index = 'index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : ''); From 1e4e8d6a133c7a653fe19a81893fad5d4fbaf4bd Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Mon, 29 Apr 2013 22:05:01 +0200 Subject: [PATCH 27/32] [-] FO : Jqzoom must be enabled to add class jqzoom --- themes/default/product.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/product.tpl b/themes/default/product.tpl index 53c76983c..03da23203 100644 --- a/themes/default/product.tpl +++ b/themes/default/product.tpl @@ -183,7 +183,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
    {if $have_image} - {$product->name|escape:'htmlall':'UTF-8'} + {$product->name|escape:'htmlall':'UTF-8'} {l s='Maximize'} {else} From cb29f20f1eab4f353ae305473613f9ea4e5c2e71 Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Mon, 29 Apr 2013 23:14:57 +0200 Subject: [PATCH 28/32] // remove unused .show() --- themes/default/js/product.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index f0dff6b54..2ea7f296d 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -423,9 +423,8 @@ function displayImage(domAAroundImgThumb, no_animation) if ($('#bigpic').attr('src') != newSrc) { $('#bigpic').attr('src', newSrc).load(function() { - $(this).show(); - if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) - $(this).attr('rel', domAAroundImgThumb.attr('href')); + if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) + $(this).attr('rel', domAAroundImgThumb.attr('href')); }); } $('#views_block li a').removeClass('shown'); From 00bd78e843dc0159a8fb878b16a280f5909f5d8f Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Tue, 30 Apr 2013 11:09:08 +0200 Subject: [PATCH 29/32] // BO: Improve product display on supplier page --- .../template/controllers/suppliers/helpers/view/view.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl index db49a35d2..fec2106d7 100644 --- a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl @@ -30,7 +30,7 @@

    {$supplier->name}

    {l s='Number of products:'} {count($products)}

    - +
    @@ -47,7 +47,7 @@ - + @@ -59,7 +59,7 @@ - + From 4d961564f7d66d816623d0a8381504d415cafb10 Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Tue, 30 Apr 2013 11:23:18 +0200 Subject: [PATCH 30/32] [-] FO: replace logo on the left (fixed bug RTL language - #PSCFV-8891) --- themes/default/css/global.css | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/default/css/global.css b/themes/default/css/global.css index b5b23061e..716932464 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -547,6 +547,7 @@ div.star_hover a, div.star a:hover { background-position: 0 -32px } #header {position:relative} #header_logo { position: absolute; + left:0; top: 30px; z-index: 1; } From e0a16977ef118de6bf4e031daf0b73bf3fb1e678 Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Tue, 30 Apr 2013 11:34:13 +0200 Subject: [PATCH 31/32] [-] FO: improve some css for RTL language --- themes/default/css/global.css | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/themes/default/css/global.css b/themes/default/css/global.css index 716932464..de3f158aa 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -296,7 +296,6 @@ table.table_block td { text-shadow:0 1px 0 #000; text-transform:uppercase; background:#383838; - text-align:left; font-weight: bold; } .block .title_block a, .block h4 a {color:#fff} @@ -1977,7 +1976,6 @@ div.star_hover a, div.star a:hover { background-position: 0 -12px } padding:15px 10px; } .blockcategories_footer .category_footer {float:left;clear:none;} -.blockcategories_footer .category_footer .list{float:left;} .blockcategories_footer ul ul {display:none !important} @@ -2040,10 +2038,13 @@ tr.subitem > td:first-child + td { } -.blockmanufacturer form {margin-top:10px;} +.blockmanufacturer form { + margin-top: 10px; + text-align: center; + width: 200px; +} .blockmanufacturer p { padding:0; - text-align:center } /*************** Block LOGO PAYMENT ***************/ @@ -2101,10 +2102,13 @@ tr.subitem > td:first-child + td { background:url(../../../modules/blocksupplier/img/arrow_right_2.png) no-repeat 10px 10px transparent } -.blocksupplier form {margin-top:10px;} +.blocksupplier form { + margin-top: 10px; + text-align: center; + width: 200px; +} .blocksupplier p { padding:0; - text-align:center } .ie7 #featured-products_block_center .product_image span.new {top:110px;right:0;width:94%} From 46f7922a8f762d16478d62a8147fa936fec6bfcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 30 Apr 2013 12:33:52 +0200 Subject: [PATCH 32/32] // id_product_attribute is not necessary in the cache name of Product::getPriceStatic for cart_quantity --- classes/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index 4c32d433f..d253d87f7 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2470,7 +2470,7 @@ class ProductCore extends ObjectModel if ((int)$id_cart) { $condition = ''; - $cache_name = (int)$id_cart.'_'.(int)$id_product.'_'.(int)$id_product_attribute; + $cache_name = (int)$id_cart.'_'.(int)$id_product; if (!isset(self::$_cart_quantity[$cache_name]) || self::$_cart_quantity[$cache_name] != (int)$quantity) self::$_cart_quantity[$cache_name] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT SUM(`quantity`)
    {l s='Product name'} {l s='Attribute name'}{$product->name} {l s='N/A'} {if empty($product->product_supplier_reference)}{l s='N/A'}{else}{$product->product_supplier_reference}{/if}{if empty($product->product_supplier_price_te)}{l s='N/A'}{else}{$product->product_supplier_price_te}{/if}{if empty($product->product_supplier_price_te)}0{else}{$product->product_supplier_price_te}{/if} {if empty($product->reference)}{l s='N/A'}{else}{$product->reference}{/if} {if empty($product->ean13)}{l s='N/A'}{else}{$product->ean13}{/if} {if empty($product->upc)}{l s='N/A'}{else}{$product->upc}{/if}{$product->name} {if empty($product_attribute.attributes)}{l s='N/A'}{else}{$product_attribute.attributes}{/if} {if empty($product_attribute.product_supplier_reference)}{l s='N/A'}{else}{$product_attribute.product_supplier_reference}{/if}{if empty($product_attribute.product_supplier_price_te)}{l s='N/A'}{else}{$product_attribute.product_supplier_price_te}{/if}{if empty($product_attribute.product_supplier_price_te)}0{else}{$product_attribute.product_supplier_price_te}{/if} {if empty($product_attribute.reference)}{l s='N/A'}{else}{$product_attribute.reference}{/if} {if empty($product_attribute.ean13)}{l s='N/A'}{else}{$product_attribute.ean13}{/if} {if empty($product_attribute.upc)}{l s='N/A'}{else}{$product_attribute.upc}{/if}