// id_shop on cart product (for links) + change Shop::sqlAsso() + share_order

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7687 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-07-22 08:57:51 +00:00
parent 9619b93c73
commit e62be3d793
41 changed files with 263 additions and 191 deletions
+1 -1
View File
@@ -32,7 +32,7 @@
{assign var='productAttributeId' value=$product.id_product_attribute}
{ldelim}
"id": {$product.id_product},
"link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)|addslashes|replace:'\\\'':'\''}",
"link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop)|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|truncate:15:'...':true}",
+2 -2
View File
@@ -62,14 +62,14 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
{assign var='productAttributeId' value=$product.id_product_attribute}
<dt id="cart_block_product_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
<span class="quantity-formated"><span class="quantity">{$product.cart_quantity}</span>x</span>
<a class="cart_block_product_name" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}" title="{$product.name|escape:html:'UTF-8'}">
<a class="cart_block_product_name" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop)}" title="{$product.name|escape:html:'UTF-8'}">
{$product.name|truncate:13:'...'|escape:html:'UTF-8'}</a>
<span class="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete&amp;id_product={$product.id_product}&amp;ipa={$product.id_product_attribute}&amp;token={$static_token}")}" title="{l s='remove this product from my cart' mod='blockcart'}">&nbsp;</a>{/if}</span>
<span class="price">{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total`"}{else}{displayWtPrice p="`$product.total_wt`"}{/if}</span>
</dt>
{if isset($product.attributes_small)}
<dd id="cart_block_combination_of_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}" title="{l s='Product detail'}">{$product.attributes_small}</a>
<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop)}" title="{l s='Product detail'}">{$product.attributes_small}</a>
{/if}
<!-- Customizable datas -->
+1 -1
View File
@@ -387,7 +387,7 @@ class BlockLayered extends Module
p.ean13, pl.available_later, pl.description_short, pl.link_rewrite, pl.name, i.id_image, il.legend, m.name manufacturer_name, p.condition, p.id_manufacturer, stock.quantity,
DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new
FROM '._DB_PREFIX_.'product p
'.$context->shop->sqlAsso('product', 'p', true).'
'.$context->shop->sqlAsso('product', 'p').'
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.$context->shop->sqlLang('pl').')
'.Product::sqlStock('p', 0).'
LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)
@@ -57,7 +57,7 @@ class BlockManufacturer extends Module
$context = Context::getContext();
$context->smarty->assign(array(
'manufacturers' => Manufacturer::getManufacturers(false, 0, true, false, false, false, $this->context->shop->getGroupID()),
'manufacturers' => Manufacturer::getManufacturers(),
'link' => $context->link,
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
@@ -164,7 +164,7 @@ class StatsBestProducts extends ModuleGrid
AND dr.time_end BETWEEN '.$dateBetween.'
) AS totalPageViewed
FROM '._DB_PREFIX_.'product p
'.$this->context->shop->sqlAsso('product', 'p', true).'
'.$this->context->shop->sqlAsso('product', 'p').'
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = '.(int)($this->getLang()).')
LEFT JOIN '._DB_PREFIX_.'order_detail od ON od.product_id = p.id_product
LEFT JOIN '._DB_PREFIX_.'orders o ON od.id_order = o.id_order
+1 -1
View File
@@ -147,7 +147,7 @@ class StatsCatalog extends Module
$this->_join = ' LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)';
$this->_where = ' AND cp.`id_category` = '.$id_category;
}
$this->_join .= $this->context->shop->sqlAsso('product', 'p', true);
$this->_join .= $this->context->shop->sqlAsso('product', 'p');
$result1 = $this->getQuery1(true);
$total = $result1['total'];
+3 -3
View File
@@ -82,7 +82,7 @@ class StatsCheckUp extends Module
// Get languages
$sql = 'SELECT l.*
FROM '._DB_PREFIX_.'lang l'
.$this->context->shop->sqlAsso('lang', 'l', true);
.$this->context->shop->sqlAsso('lang', 'l');
$languages = $db->ExecuteS($sql);
$arrayColors = array(
@@ -109,7 +109,7 @@ class StatsCheckUp extends Module
$sql = 'SELECT p.id_product, p.active, pl.name, (
SELECT COUNT(*)
FROM '._DB_PREFIX_.'image i
'.$this->context->shop->sqlAsso('image', 'i', true).'
'.$this->context->shop->sqlAsso('image', 'i').'
WHERE i.id_product = p.id_product
) as nbImages, (
SELECT SUM(od.product_quantity)
@@ -125,7 +125,7 @@ class StatsCheckUp extends Module
), p.quantity) as stock
FROM '._DB_PREFIX_.'product p
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = '.(int)$cookie->id_lang.')
'.$this->context->shop->sqlAsso('product', 'p', true).'
'.$this->context->shop->sqlAsso('product', 'p').'
ORDER BY '.$orderBy;
$result = $db->ExecuteS($sql);
+1 -1
View File
@@ -512,7 +512,7 @@ class StatsForecast extends Module
$langValues = '';
$sql = 'SELECT l.id_lang, l.iso_code
FROM `'._DB_PREFIX_.'lang` l
'.$this->context->shop->sqlAsso('lang', 'l', true).'
'.$this->context->shop->sqlAsso('lang', 'l').'
WHERE l.active = 1';
$languages = Db::getInstance()->ExecuteS($sql);
foreach ($languages as $language)
+1 -1
View File
@@ -103,7 +103,7 @@ class StatsProduct extends ModuleGraph
(SELECT SUM(pa.quantity) FROM '._DB_PREFIX_.'product_attribute pa WHERE pa.id_product = p.id_product), p.quantity) as quantity
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product`
'.$this->context->shop->sqlAsso('product', 'p', true).'
'.$this->context->shop->sqlAsso('product', 'p').'
'.(Tools::getValue('id_category') ? 'LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`' : '').'
WHERE pl.`id_lang` = '.(int)($id_lang).'
'.(Tools::getValue('id_category') ? 'AND cp.id_category = '.(int)(Tools::getValue('id_category')) : '').'
+1 -1
View File
@@ -75,7 +75,7 @@ class StatsStock extends Module
FROM '._DB_PREFIX_.'product_attribute pa WHERE p.id_product = pa.id_product
), p.wholesale_price * p.quantity) as stockvalue
FROM '._DB_PREFIX_.'product p
'.$this->context->shop->sqlAsso('product', 'p', true).'
'.$this->context->shop->sqlAsso('product', 'p').'
INNER JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = '.(int)$cookie->id_lang.')
WHERE 1 = 1
'.$filter;