// MERGE product_multistore branch : product fields are now editable per shop

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14682 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-04-17 13:32:12 +00:00
parent d4d1c35cb9
commit 0c2dd0cd2f
134 changed files with 3185 additions and 1789 deletions
+10 -9
View File
@@ -52,7 +52,7 @@ class WishList extends ObjectModel
public $id_shop;
/** @var string Object last modification date */
public $id_group_shop;
public $id_shop_group;
/**
* @see ObjectModel::$definition
*/
@@ -66,7 +66,7 @@ class WishList extends ObjectModel
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_group_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_shop_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
)
);
@@ -109,8 +109,8 @@ class WishList extends ObjectModel
{
if (Shop::getContextShopID())
$shop_restriction = 'AND id_shop = '.(int)Shop::getContextShopID();
elseif (Shop::getContextGroupShopID())
$shop_restriction = 'AND id_group_shop = '.(int)Shop::getContextGroupShopID();
elseif (Shop::getContextShopGroupID())
$shop_restriction = 'AND id_shop_group = '.(int)Shop::getContextShopGroupID();
else
$shop_restriction = '';
@@ -174,8 +174,8 @@ class WishList extends ObjectModel
{
if (Shop::getContextShopID())
$shop_restriction = 'AND id_shop = '.(int)Shop::getContextShopID();
elseif (Shop::getContextGroupShopID())
$shop_restriction = 'AND id_group_shop = '.(int)Shop::getContextGroupShopID();
elseif (Shop::getContextShopGroupID())
$shop_restriction = 'AND id_shop_group = '.(int)Shop::getContextShopGroupID();
else
$shop_restriction = '';
@@ -276,7 +276,7 @@ class WishList extends ObjectModel
'.Shop::addSqlAssociation('product', 'p').'
JOIN `'._DB_PREFIX_.'product_lang` pl ON pl.`id_product` = wp.`id_product`'.Shop::addSqlRestrictionOnLang('pl').'
JOIN `'._DB_PREFIX_.'wishlist` w ON w.`id_wishlist` = wp.`id_wishlist`
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON cl.`id_category` = asso_shop_product.`id_category_default` AND cl.id_lang='.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON cl.`id_category` = product_shop.`id_category_default` AND cl.id_lang='.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
WHERE w.`id_customer` = '.(int)($id_customer).'
AND pl.`id_lang` = '.(int)($id_lang).'
AND wp.`id_wishlist` = '.(int)($id_wishlist).
@@ -298,6 +298,7 @@ class WishList extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)($id_lang).')
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)($id_lang).')
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
'.Shop::addSqlAssociation('product_attribute', 'pa').'
WHERE pac.`id_product_attribute` = '.(int)($products[$i]['id_product_attribute']));
$products[$i]['attributes_small'] = '';
if ($result)
@@ -322,8 +323,8 @@ class WishList extends ObjectModel
{
if (Shop::getContextShopID())
$shop_restriction = 'AND id_shop = '.(int)Shop::getContextShopID();
elseif (Shop::getContextGroupShopID())
$shop_restriction = 'AND id_group_shop = '.(int)Shop::getContextGroupShopID();
elseif (Shop::getContextShopGroupID())
$shop_restriction = 'AND id_shop_group = '.(int)Shop::getContextShopGroupID();
else
$shop_restriction = '';
+1 -1
View File
@@ -54,7 +54,7 @@ if ($context->customer->isLogged())
{
$wishlist = new WishList();
$wishlist->id_shop = $context->shop->id;
$wishlist->id_group_shop = $context->shop->id_group_shop;
$wishlist->id_shop_group = $context->shop->id_shop_group;
$modWishlist = new BlockWishList();
$wishlist->name = $modWishlist->default_wishlist_name;
@@ -82,7 +82,7 @@ class BlockWishListMyWishListModuleFrontController extends ModuleFrontController
{
$wishlist = new WishList();
$wishlist->id_shop = $this->context->shop->id;
$wishlist->id_group_shop = $this->context->shop->id_group_shop;
$wishlist->id_shop_group = $this->context->shop->id_shop_group;
$wishlist->name = $name;
$wishlist->id_customer = (int)$this->context->customer->id;
list($us, $s) = explode(' ', microtime());
+1 -1
View File
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS `PREFIX_wishlist` (
`name` varchar(64) character set utf8 NOT NULL,
`counter` int(10) unsigned NULL,
`id_shop` int(10) unsigned default 1,
`id_group_shop` int(10) unsigned default 1,
`id_shop_group` int(10) unsigned default 1,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_wishlist`)