From ce26f23f5bb45cfac32f5df141a9dca69bc86b89 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Wed, 23 Nov 2011 16:31:53 +0000 Subject: [PATCH] // Small fixes --- admin-dev/themes/template/header.tpl | 4 ++-- classes/Category.php | 8 +++++--- classes/Supplier.php | 1 + controllers/admin/AdminGroupShopController.php | 2 +- themes/prestashop/shopping-cart-product-line.tpl | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/admin-dev/themes/template/header.tpl b/admin-dev/themes/template/header.tpl index 38dba83a5..6f2984474 100644 --- a/admin-dev/themes/template/header.tpl +++ b/admin-dev/themes/template/header.tpl @@ -220,9 +220,9 @@ {if $display_header && $is_multishop && $shop_context != 'all'}
{if $shop_context == 'group'} - {l s='You are configuring your store for group shop '}{$group_shop->name} + {l s='You are configuring your store for group shop'} {$group_shop->name} {elseif $shop_context == 'shop'} - {l s='You are configuring your store for shop '}{$shop->name} + {l s='You are configuring your store for shop'} {$shop->name} {/if}
{/if} diff --git a/classes/Category.php b/classes/Category.php index 5091c635a..ad1e319d5 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -591,7 +591,8 @@ class CategoryCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product` WHERE cp.`id_category` = '.(int)$this->id. ($active ? ' AND p.`active` = 1' : ''). - ($id_supplier ? 'AND p.id_supplier = '.(int)$id_supplier : ''); + ($id_supplier ? 'AND p.id_supplier = '.(int)$id_supplier : ''). + ' GROUP BY p.id_product'; return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } @@ -638,7 +639,8 @@ class CategoryCore extends ObjectModel AND sa.id_product_attribute = 0 WHERE cp.`id_category` = '.(int)$this->id .($active ? ' AND p.`active` = 1' : '') - .($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : ''); + .($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : ''). + ' GROUP BY p.id_product'; if ($random === true) { $sql .= ' ORDER BY RAND()'; @@ -713,7 +715,7 @@ class CategoryCore extends ObjectModel return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT * FROM `'._DB_PREFIX_.'category` - WHERE '.$this->nleft.' < nleft AND nright < '.$this->nright + WHERE '.(int)$this->nleft.' < nleft AND nright < '.(int)$this->nright ); } diff --git a/classes/Supplier.php b/classes/Supplier.php index e31a093d5..98d7e20d3 100644 --- a/classes/Supplier.php +++ b/classes/Supplier.php @@ -122,6 +122,7 @@ class SupplierCore extends ObjectModel $query = 'SELECT s.*, sl.`description`'; $query .= ' FROM `'._DB_PREFIX_.'supplier` as s LEFT JOIN `'._DB_PREFIX_.'supplier_lang` sl ON (s.`id_supplier` = sl.`id_supplier` AND sl.`id_lang` = '.(int)$id_lang.') + '.Context::getContext()->shop->addSqlAssociation('supplier', 's').' '.($active ? ' WHERE s.`active` = 1 ' : ''); $query .= ' ORDER BY s.`name` ASC'.($p ? ' LIMIT '.(((int)$p - 1) * (int)$n).','.(int)$n : ''); $suppliers = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); diff --git a/controllers/admin/AdminGroupShopController.php b/controllers/admin/AdminGroupShopController.php index 8aa23222f..e35884b6f 100644 --- a/controllers/admin/AdminGroupShopController.php +++ b/controllers/admin/AdminGroupShopController.php @@ -139,7 +139,7 @@ class AdminGroupShopControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Enable or disable shop') + 'desc' => $this->l('Enable or disable group shop') ) ), 'submit' => array( diff --git a/themes/prestashop/shopping-cart-product-line.tpl b/themes/prestashop/shopping-cart-product-line.tpl index bccefa9a1..badd9f5e0 100644 --- a/themes/prestashop/shopping-cart-product-line.tpl +++ b/themes/prestashop/shopping-cart-product-line.tpl @@ -24,7 +24,7 @@ * International Registered Trademark & Property of PrestaShop SA *} - + {$product.name|escape:'htmlall':'UTF-8'}