Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
.toolbarBox .process-icon-new-module { background-image: url('../img/process-icon-new-module.png')}
|
||||
.toolbarBox .process-icon-new-module-addon { background-image: url('../img/process-icon-new-module-addon.png')}
|
||||
|
||||
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:1}
|
||||
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:11}
|
||||
|
||||
|
||||
/*FILTER MODULE*/
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}'+jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
|
||||
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}' + ' ' + jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
|
||||
|
||||
var input_hidden = document.createElement("input");
|
||||
input_hidden.setAttribute('type', 'hidden');
|
||||
@@ -168,7 +168,7 @@
|
||||
{foreach $input['values'] key=key item=category }
|
||||
<tr class="alt_row" id="{$category.id_category}">
|
||||
<td>{$category.path}</td>
|
||||
<td>{l s='Discount: %d%%' sprintf=$category.reduction}</td>
|
||||
<td>{l s='Discount: %.2f%%' sprintf=$category.reduction}</td>
|
||||
<td>
|
||||
<a href="#" onclick="deleteCategoryReduction({$category.id_category});"><img src="../img/admin/delete.gif"></a>
|
||||
<input type="hidden" class="category_reduction" name="category_reduction[{$category.id_category}]" value="{$category.reduction}">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<fieldset>
|
||||
<ul>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Name:'}</span> {$group->name[$language->id]}</li>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Discount: %d%%' sprintf=$group->reduction}</span></li>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Discount: %.2f%%' sprintf=$group->reduction}</span></li>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Current category discount:'}</span>
|
||||
{if !$categorieReductions}
|
||||
{l s='None'}
|
||||
@@ -39,7 +39,7 @@
|
||||
{foreach $categorieReductions key=key item=category }
|
||||
<tr class="alt_row">
|
||||
<td>{$category.path}</td>
|
||||
<td>{l s='Discount: %d%%' sprintf=$category.reduction}</td>
|
||||
<td>{l s='Discount: %.2f%%' sprintf=$category.reduction}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
});
|
||||
|
||||
// Method to check / uncheck all modules checkbox
|
||||
$('#checkme').click(function()
|
||||
$('#moduleContainer').on("click", "#checkme", function()
|
||||
{
|
||||
if ($(this).attr("rel") == 'false')
|
||||
{
|
||||
@@ -321,8 +321,8 @@
|
||||
catch(e){}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.toggle_favorite').live('click', function(event)
|
||||
|
||||
$('#moduleContainer').on("click", ".toggle_favorite", function()
|
||||
{
|
||||
var el = $(this);
|
||||
var value_pref = el.data('value');
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
{if isset($fields_value[$input.name].image) && $fields_value[$input.name].image}
|
||||
<div id="image">
|
||||
{$fields_value[$input.name].image}
|
||||
<p align="center">{l s='File size'} {$fields_value[$input.name].size}kb</p>
|
||||
<p align="center">{l s='File size'} {$fields_value[$input.name].size}{l s='kb'}</p>
|
||||
<a href="{$current}&{$identifier}={$form_id}&token={$token}&deleteImage=1">
|
||||
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
|
||||
</a>
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
{/if}
|
||||
class="{if !$no_link}pointer{/if}
|
||||
{if isset($params.position) && $order_by == 'position' && $order_way != 'DESC'} dragHandle{/if}
|
||||
{if isset($params.class)} {$params.class}{/if}
|
||||
{if isset($params.align)} {$params.align}{/if}"
|
||||
{if (!isset($params.position) && !$no_link && !isset($params.remove_onclick))}
|
||||
onclick="document.location = '{$current_index}&{$identifier}={$tr.$identifier}{if $view}&view{else}&update{/if}{$table}&token={$token}'">
|
||||
|
||||
@@ -264,13 +264,17 @@ class AddressCore extends ObjectModel
|
||||
if(!isset($id_address) || empty($id_address))
|
||||
return false;
|
||||
|
||||
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT c.`active`
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = a.`id_country`
|
||||
WHERE a.`id_address` = '.(int)$id_address))
|
||||
return false;
|
||||
return ($result['active']);
|
||||
$cache_id = 'Address::isCountryActiveById_'.(int)$id_address;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getvalue('
|
||||
SELECT c.`active`
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = a.`id_country`
|
||||
WHERE a.`id_address` = '.(int)$id_address);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,12 +328,17 @@ class AddressCore extends ObjectModel
|
||||
{
|
||||
if (!$id_customer)
|
||||
return false;
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `id_address`
|
||||
FROM `'._DB_PREFIX_.'address`
|
||||
WHERE `id_customer` = '.(int)$id_customer.' AND `deleted` = 0'.($active ? ' AND `active` = 1' : '')
|
||||
);
|
||||
$cache_id = 'Address::getFirstCustomerAddressId_'.(int)$id_customer.'-'.(bool)$active;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `id_address`
|
||||
FROM `'._DB_PREFIX_.'address`
|
||||
WHERE `id_customer` = '.(int)$id_customer.' AND `deleted` = 0'.($active ? ' AND `active` = 1' : '')
|
||||
);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,5 +388,4 @@ class AddressCore extends ObjectModel
|
||||
$query->where('id_warehouse = 0');
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -190,7 +190,7 @@ class CMSCore extends ObjectModel
|
||||
return (Db::getInstance()->getValue($sql));
|
||||
}
|
||||
|
||||
public static function getCMSPages($id_lang = null, $id_cms_category = null, $active = true)
|
||||
public static function getCMSPages($id_lang = null, $id_cms_category = null, $active = true, $id_shop = null)
|
||||
{
|
||||
$sql = new DbQuery();
|
||||
$sql->select('*');
|
||||
@@ -198,6 +198,9 @@ class CMSCore extends ObjectModel
|
||||
if ($id_lang)
|
||||
$sql->innerJoin('cms_lang', 'l', 'c.id_cms = l.id_cms AND l.id_lang = '.(int)$id_lang);
|
||||
|
||||
if ($id_shop)
|
||||
$sql->innerJoin('cms_shop', 'cs', 'c.id_cms = cs.id_cms AND cs.id_shop = '.(int)$id_shop);
|
||||
|
||||
if ($active)
|
||||
$sql->where('c.active = 1');
|
||||
|
||||
|
||||
@@ -277,17 +277,20 @@ class CarrierCore extends ObjectModel
|
||||
|
||||
public function getMaxDeliveryPriceByWeight($id_zone)
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_weight').'
|
||||
ORDER BY w.`delimiter2` DESC LIMIT 1';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
if (!isset($result[0]['price']))
|
||||
return false;
|
||||
return $result[0]['price'];
|
||||
$cache_id = 'Carrier::getMaxDeliveryPriceByWeight_'.(int)$this->id.'-'.(int)$id_zone;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_weight').'
|
||||
ORDER BY w.`delimiter2` DESC';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -357,17 +360,20 @@ class CarrierCore extends ObjectModel
|
||||
|
||||
public function getMaxDeliveryPriceByPrice($id_zone)
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_price').'
|
||||
ORDER BY r.`delimiter2` DESC LIMIT 1';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
if (!isset($result[0]['price']))
|
||||
return false;
|
||||
return $result[0]['price'];
|
||||
$cache_id = 'Carrier::getMaxDeliveryPriceByPrice_'.(int)$this->id.'-'.(int)$id_zone;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_price').'
|
||||
ORDER BY r.`delimiter2` DESC';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -449,7 +455,13 @@ class CarrierCore extends ObjectModel
|
||||
GROUP BY c.`id_carrier`
|
||||
ORDER BY c.`position` ASC';
|
||||
|
||||
$carriers = Db::getInstance()->executeS($sql);
|
||||
$cache_id = 'Carrier::getCarriers_'.md5($sql);
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$carriers = Db::getInstance()->executeS($sql);
|
||||
Cache::store($cache_id, $carriers);
|
||||
}
|
||||
$carriers = Cache::retrieve($cache_id);
|
||||
|
||||
if (is_array($carriers) && count($carriers))
|
||||
{
|
||||
@@ -1199,7 +1211,14 @@ class CarrierCore extends ObjectModel
|
||||
$query->where('pc.id_product = '.(int)$product->id);
|
||||
$query->where('pc.id_shop = '.(int)$id_shop);
|
||||
|
||||
$carriers_for_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
$cache_id = 'Carrier::getAvailableCarrierList_'.(int)$product->id.'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$carriers_for_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
Cache::store($cache_id, $carriers_for_product);
|
||||
}
|
||||
$carriers_for_product = Cache::retrieve($cache_id);
|
||||
|
||||
$carrier_list = array();
|
||||
if (!empty($carriers_for_product))
|
||||
{
|
||||
|
||||
@@ -325,7 +325,7 @@ class CartCore extends ObjectModel
|
||||
if (!CartRule::isFeatureActive() || !$this->id)
|
||||
return array();
|
||||
|
||||
$cache_key = 'Cart::getCartRules'.$this->id.'-'.$filter;
|
||||
$cache_key = 'Cart::getCartRules_'.$this->id.'-'.$filter;
|
||||
if (!Cache::isStored($cache_key))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
@@ -368,12 +368,16 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
if (!CartRule::isFeatureActive())
|
||||
return 0;
|
||||
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'cart_cart_rule`
|
||||
WHERE `id_cart_rule` = '.(int)$id_cart_rule.' AND `id_cart` = '.(int)$this->id
|
||||
);
|
||||
$cache_id = 'Cart::getDiscountsCustomer_'.(int)$this->id.'-'.(int)$id_cart_rule;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'cart_cart_rule`
|
||||
WHERE `id_cart_rule` = '.(int)$id_cart_rule.' AND `id_cart` = '.(int)$this->id);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function getLastProduct()
|
||||
@@ -632,14 +636,19 @@ class CartCore extends ObjectModel
|
||||
|
||||
if (!isset($row['pai_id_image']) || $row['pai_id_image'] == 0)
|
||||
{
|
||||
$row2 = Db::getInstance()->getRow('
|
||||
SELECT image_shop.`id_image` id_image, il.`legend`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (i.id_image = image_shop.id_image AND image_shop.cover=1 AND image_shop.id_shop='.(int)$row['id_shop'].')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
|
||||
WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 1'
|
||||
);
|
||||
|
||||
$cache_id = 'Cart::getProducts_'.'-pai_id_image-'.(int)$row['id_product'].'-'.(int)$this->id_lang.'-'.(int)$row['id_shop'];
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$row2 = Db::getInstance()->getRow('
|
||||
SELECT image_shop.`id_image` id_image, il.`legend`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (i.id_image = image_shop.id_image AND image_shop.cover=1 AND image_shop.id_shop='.(int)$row['id_shop'].')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
|
||||
WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 122'
|
||||
);
|
||||
Cache::store($cache_id, $row2);
|
||||
}
|
||||
$row2 = Cache::retrieve($cache_id);
|
||||
if (!$row2)
|
||||
$row2 = array('id_image' => false, 'legend' => false);
|
||||
else
|
||||
@@ -727,7 +736,7 @@ class CartCore extends ObjectModel
|
||||
*
|
||||
* @result integer Products quantity
|
||||
*/
|
||||
public function nbProducts()
|
||||
public function nbProducts()
|
||||
{
|
||||
if (!$this->id)
|
||||
return 0;
|
||||
@@ -1078,9 +1087,9 @@ class CartCore extends ObjectModel
|
||||
);
|
||||
$id_customization = Db::getInstance()->Insert_ID();
|
||||
}
|
||||
|
||||
|
||||
$query = 'INSERT INTO `'._DB_PREFIX_.'customized_data` (`id_customization`, `type`, `index`, `value`)
|
||||
VALUES ('.(int)$id_customization.', '.(int)$type.', '.(int)$index.', \''.pSql($field).'\')';
|
||||
VALUES ('.(int)$id_customization.', '.(int)$type.', '.(int)$index.', \''.pSQL($field).'\')';
|
||||
|
||||
if (!Db::getInstance()->execute($query))
|
||||
return false;
|
||||
@@ -1094,7 +1103,13 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public function orderExists()
|
||||
{
|
||||
return (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$this->id);
|
||||
$cache_id = 'Cart::orderExists_'.(int)$this->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$this->id);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2277,18 +2292,23 @@ class CartCore extends ObjectModel
|
||||
public function getAddressCollection()
|
||||
{
|
||||
$collection = array();
|
||||
$result = Db::getInstance()->executeS(
|
||||
'SELECT DISTINCT `id_address_delivery`
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE id_cart = '.(int)$this->id
|
||||
);
|
||||
$cache_id = 'Cart::getAddressCollection'.(int)$this->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS(
|
||||
'SELECT DISTINCT `id_address_delivery`
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE id_cart = '.(int)$this->id
|
||||
);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
$result = Cache::retrieve($cache_id);
|
||||
|
||||
$result[] = array('id_address_delivery' => (int)$this->id_address_delivery);
|
||||
|
||||
foreach ($result as $row)
|
||||
if ((int)$row['id_address_delivery'] != 0)
|
||||
$collection[(int)$row['id_address_delivery']] = new Address((int)$row['id_address_delivery']);
|
||||
|
||||
return $collection;
|
||||
}
|
||||
|
||||
@@ -3038,7 +3058,6 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public function addTextFieldToProduct($id_product, $index, $type, $text_value)
|
||||
{
|
||||
$text_value = str_replace(array("\n", "\r"), '', nl2br($text_value));
|
||||
if (!_PS_MAGIC_QUOTES_GPC_){
|
||||
$text_value = str_replace('\\', '\\\\', $text_value);
|
||||
$text_value = str_replace('\'', '\\\'', $text_value);
|
||||
@@ -3466,10 +3485,14 @@ class CartCore extends ObjectModel
|
||||
)
|
||||
WHERE `id_cart` = '.(int)$this->id.'
|
||||
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '');
|
||||
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
if ($result)
|
||||
$emptyCache = true;
|
||||
|
||||
$cache_id = 'Cart::setNoMultishipping'.(int)$this->id.'-'.(int)$this->id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
if ($result = (bool)Db::getInstance()->execute($sql))
|
||||
$emptyCache = true;
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
|
||||
if (Customization::isFeatureActive())
|
||||
Db::getInstance()->execute('
|
||||
|
||||
@@ -666,9 +666,9 @@ class CategoryCore extends ObjectModel
|
||||
* @param boolean $active return only active categories
|
||||
* @return array categories
|
||||
*/
|
||||
public static function getHomeCategories($id_lang, $active = true)
|
||||
public static function getHomeCategories($id_lang, $active = true, $id_shop = false)
|
||||
{
|
||||
return self::getChildren(Configuration::get('PS_HOME_CATEGORY'), $id_lang, $active);
|
||||
return self::getChildren(Configuration::get('PS_HOME_CATEGORY'), $id_lang, $active, $id_shop);
|
||||
}
|
||||
|
||||
public static function getRootCategory($id_lang = null, Shop $shop = null)
|
||||
@@ -704,16 +704,22 @@ class CategoryCore extends ObjectModel
|
||||
if (!Validate::isBool($active))
|
||||
die(Tools::displayError());
|
||||
|
||||
$query = 'SELECT c.`id_category`, cl.`name`, cl.`link_rewrite`, category_shop.`id_shop`
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').')
|
||||
'.Shop::addSqlAssociation('category', 'c').'
|
||||
WHERE `id_lang` = '.(int)$id_lang.'
|
||||
AND c.`id_parent` = '.(int)$id_parent.'
|
||||
'.($active ? 'AND `active` = 1' : '').'
|
||||
GROUP BY c.`id_category`
|
||||
ORDER BY category_shop.`position` ASC';
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
$cache_id = 'Category::getChildren_'.(int)$id_parent.'-'.(int)$id_lang.'-'.(bool)$active.'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$query = 'SELECT c.`id_category`, cl.`name`, cl.`link_rewrite`, category_shop.`id_shop`
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').')
|
||||
'.Shop::addSqlAssociation('category', 'c').'
|
||||
WHERE `id_lang` = '.(int)$id_lang.'
|
||||
AND c.`id_parent` = '.(int)$id_parent.'
|
||||
'.($active ? 'AND `active` = 1' : '').'
|
||||
GROUP BY c.`id_category`
|
||||
ORDER BY category_shop.`position` ASC';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1008,14 +1014,20 @@ class CategoryCore extends ObjectModel
|
||||
public function getGroups()
|
||||
{
|
||||
$groups = array();
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT cg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group cg
|
||||
WHERE cg.`id_category` = '.(int)$this->id
|
||||
);
|
||||
foreach ($result as $group)
|
||||
$groups[] = $group['id_group'];
|
||||
return $groups;
|
||||
$cache_id = 'Category::getGroups_'.(int)$this->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT cg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group cg
|
||||
WHERE cg.`id_category` = '.(int)$this->id
|
||||
);
|
||||
$groups = array();
|
||||
foreach ($result as $group)
|
||||
$groups[] = $group['id_group'];
|
||||
Cache::store($cache_id, $groups);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function addGroupsIfNoExist($id_group)
|
||||
@@ -1036,24 +1048,23 @@ class CategoryCore extends ObjectModel
|
||||
*/
|
||||
public function checkAccess($id_customer)
|
||||
{
|
||||
if (!$id_customer)
|
||||
$cache_id = 'Category::checkAccess_'.(int)$this->id.'-'.$id_customer.(!$id_customer ? '-'.(int)Group::getCurrent()->id : '');
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
if (!$id_customer)
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group ctg
|
||||
WHERE ctg.`id_category` = '.(int)$this->id.' AND ctg.`id_group` = '.(int)Group::getCurrent()->id.'
|
||||
');
|
||||
} else {
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
WHERE ctg.`id_category` = '.(int)$this->id.' AND ctg.`id_group` = '.(int)Group::getCurrent()->id);
|
||||
else
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group ctg
|
||||
INNER JOIN '._DB_PREFIX_.'customer_group cg on (cg.`id_group` = ctg.`id_group` AND cg.`id_customer` = '.(int)$id_customer.')
|
||||
WHERE ctg.`id_category` = '.(int)$this->id
|
||||
);
|
||||
WHERE ctg.`id_category` = '.(int)$this->id);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
if ($result && isset($result['id_group']) && $result['id_group'])
|
||||
return true;
|
||||
return false;
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1199,12 +1210,16 @@ class CategoryCore extends ObjectModel
|
||||
*/
|
||||
public static function getInterval($id)
|
||||
{
|
||||
$sql = 'SELECT nleft, nright, level_depth
|
||||
FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.(int)$id;
|
||||
if (!$result = Db::getInstance()->getRow($sql))
|
||||
return false;
|
||||
return $result;
|
||||
$cache_id = 'Category::getInterval_'.(int)$id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT nleft, nright, level_depth
|
||||
FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.(int)$id;
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1386,11 +1401,17 @@ class CategoryCore extends ObjectModel
|
||||
|
||||
public static function getCategoriesWithoutParent()
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT DISTINCT c.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
WHERE `level_depth` = 1');
|
||||
$cache_id = 'Category::getCategoriesWithoutParent_'.(int)Context::getContext()->language->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT DISTINCT c.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
WHERE `level_depth` = 1');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function isRootCategoryForAShop()
|
||||
@@ -1409,12 +1430,17 @@ class CategoryCore extends ObjectModel
|
||||
public static function getTopCategory($id_lang = null)
|
||||
{
|
||||
if (is_null($id_lang))
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
$id_category = Db::getInstance()->getValue('
|
||||
SELECT `id_category`
|
||||
FROM `'._DB_PREFIX_.'category`
|
||||
WHERE `id_parent` = 0');
|
||||
return new Category($id_category, $id_lang);
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
$cache_id = 'Category::getTopCategory_'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$id_category = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_category`
|
||||
FROM `'._DB_PREFIX_.'category`
|
||||
WHERE `id_parent` = 0');
|
||||
Cache::store($cache_id, new Category($id_category, $id_lang));
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function addPosition($position, $id_shop = null)
|
||||
|
||||
@@ -296,10 +296,16 @@ class CurrencyCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdByIsoCode($iso_code, $id_shop = 0)
|
||||
{
|
||||
$query = Currency::getIdByQuery($id_shop);
|
||||
$query->where('iso_code = \''.pSQL($iso_code).'\'');
|
||||
|
||||
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query->build());
|
||||
$cache_id = 'Currency::getIdByIsoCode_'.pSQL($iso_code).'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$query = Currency::getIdByQuery($id_shop);
|
||||
$query->where('iso_code = \''.pSQL($iso_code).'\'');
|
||||
|
||||
$result = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query->build());
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -362,15 +362,18 @@ class CustomerCore extends ObjectModel
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_customer))
|
||||
return true;
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = \''.(int)$id_customer.'\'
|
||||
AND active = 1
|
||||
AND `deleted` = 0');
|
||||
if (isset($result['id_customer']))
|
||||
return false;
|
||||
return true;
|
||||
$cache_id = 'Customer::isBanned_'.(int)$id_customer;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (bool)!Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = \''.(int)$id_customer.'\'
|
||||
AND active = 1
|
||||
AND `deleted` = 0');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -413,7 +416,7 @@ class CustomerCore extends ObjectModel
|
||||
public static function customerHasAddress($id_customer, $id_address)
|
||||
{
|
||||
$key = (int)$id_customer.'-'.(int)$id_address;
|
||||
if (!array_key_exists($id_address, self::$_customerHasAddress))
|
||||
if (!array_key_exists($key, self::$_customerHasAddress))
|
||||
{
|
||||
self::$_customerHasAddress[$key] = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `id_address`
|
||||
@@ -439,15 +442,22 @@ class CustomerCore extends ObjectModel
|
||||
*/
|
||||
public function getAddresses($id_lang)
|
||||
{
|
||||
$sql = 'SELECT DISTINCT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)
|
||||
'.(Context::getContext()->shop->getGroup()->share_order ? '' : Shop::addSqlAssociation('country', 'c')).'
|
||||
WHERE `id_lang` = '.(int)$id_lang.' AND `id_customer` = '.(int)$this->id.' AND a.`deleted` = 0';
|
||||
$share_order = (bool)Context::getContext()->shop->getGroup()->share_order;
|
||||
$cache_id = 'Customer::getAddresses'.(int)$this->id.'-'.(int)$id_lang.'-'.$share_order;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT DISTINCT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)
|
||||
'.($share_order ? '' : Shop::addSqlAssociation('country', 'c')).'
|
||||
WHERE `id_lang` = '.(int)$id_lang.' AND `id_customer` = '.(int)$this->id.' AND a.`deleted` = 0';
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -476,12 +486,17 @@ class CustomerCore extends ObjectModel
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_customer) || !Validate::isMd5($passwd))
|
||||
die (Tools::displayError());
|
||||
|
||||
$sql = 'SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = '.$id_customer.'
|
||||
$cache_id = 'Customer::checkPassword'.(int)$id_customer.'-'.$passwd;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = '.$id_customer.'
|
||||
AND `passwd` = \''.$passwd.'\'';
|
||||
return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -574,12 +589,16 @@ class CustomerCore extends ObjectModel
|
||||
|
||||
public static function customerIdExistsStatic($id_customer)
|
||||
{
|
||||
$row = Db::getInstance()->getRow('
|
||||
SELECT `id_customer`
|
||||
FROM '._DB_PREFIX_.'customer c
|
||||
WHERE c.`id_customer` = '.(int)$id_customer);
|
||||
|
||||
return isset($row['id_customer']);
|
||||
$cache_id = 'Customer::customerIdExistsStatic'.(int)$id_customer;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_customer`
|
||||
FROM '._DB_PREFIX_.'customer c
|
||||
WHERE c.`id_customer` = '.(int)$id_customer);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -305,12 +305,21 @@ class GroupCore extends ObjectModel
|
||||
public static function getCurrent()
|
||||
{
|
||||
static $groups = array();
|
||||
|
||||
$customer = Context::getContext()->customer;
|
||||
if (Validate::isLoadedObject($customer))
|
||||
{
|
||||
$id_group = (int)$customer->id_default_group;
|
||||
$group = new Group((int)$id_group);
|
||||
if (!$group->isAssociatedToShop(Context::getContext()->shop->id))
|
||||
$group = new Group((int)Configuration::get('PS_CUSTOMER_GROUP'));
|
||||
}
|
||||
else
|
||||
$id_group = (int)Configuration::get('PS_UNIDENTIFIED_GROUP');
|
||||
|
||||
|
||||
if (!isset($groups[$id_group]) && isset($group))
|
||||
$groups[$id_group] = $group;
|
||||
|
||||
if (!isset($groups[$id_group]))
|
||||
$groups[$id_group] = new Group($id_group);
|
||||
|
||||
|
||||
@@ -326,7 +326,10 @@ class HookCore extends ObjectModel
|
||||
if ($frontend)
|
||||
{
|
||||
$sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`');
|
||||
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
|
||||
if (Validate::isLoadedObject($context->shop))
|
||||
$sql->where('mg.id_shop = '.((int)$context->shop->id).' AND mg.`id_group` IN ('.implode(', ', $groups).')');
|
||||
else
|
||||
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
|
||||
$sql->groupBy('hm.id_hook, hm.id_module');
|
||||
}
|
||||
|
||||
|
||||
@@ -619,6 +619,35 @@ class LanguageCore extends ObjectModel
|
||||
return Db::getInstance()->getValue('SELECT `language_code` FROM `'._DB_PREFIX_.'lang` WHERE `iso_code` = \''.pSQL(strtolower($iso_code)).'\'');
|
||||
}
|
||||
|
||||
public static function getLanguageByIETFCode($code)
|
||||
{
|
||||
if (!Validate::isLanguageCode($code))
|
||||
die(sprintf(Tools::displayError('Fatal error: IETF code %s is not correct'), $code));
|
||||
|
||||
// $code is in the form of 'xx-YY' where xx is the language code
|
||||
// and 'YY' a country code identifying a variant of the language.
|
||||
$lang_country = explode('-', $code);
|
||||
// Get the language component of the code
|
||||
$lang = $lang_country[0];
|
||||
|
||||
// Find the id_lang of the language.
|
||||
// We look for anything with the correct language code
|
||||
// and sort on equality with the exact IETF code wanted.
|
||||
// That way using only one query we get either the exact wanted language
|
||||
// or a close match.
|
||||
$id_lang = Db::getInstance()->getValue(
|
||||
'SELECT `id_lang` FROM '
|
||||
.'`'._DB_PREFIX_.'lang` WHERE LEFT(`language_code`,2) = \''.pSQL($lang).'\' '
|
||||
.'ORDER BY language_code = \''.pSQL($code).'\' DESC'
|
||||
);
|
||||
|
||||
// Instantiate the Language object if we found it.
|
||||
if ($id_lang)
|
||||
return new Language($id_lang);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array (id_lang, iso_code)
|
||||
*
|
||||
|
||||
@@ -423,6 +423,15 @@ class LinkCore
|
||||
*/
|
||||
public function getPageLink($controller, $ssl = null, $id_lang = null, $request = null, $request_url_encode = false, $id_shop = null)
|
||||
{
|
||||
|
||||
//If $controller contains '&' char, it means that $controller contains request data and must be parsed first
|
||||
$p = strpos($controller, '&');
|
||||
if ($p !== false) {
|
||||
$request = substr($controller, $p + 1);
|
||||
$request_url_encode = false;
|
||||
$controller = substr($controller, 0, $p);
|
||||
}
|
||||
|
||||
$controller = Tools::strReplaceFirst('.php', '', $controller);
|
||||
if (!$id_lang)
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
|
||||
@@ -63,6 +63,7 @@ class LocalizationPackCore
|
||||
|
||||
if ($install_mode && $res && isset($this->iso_currency))
|
||||
{
|
||||
Cache::clean('Currency::getIdByIsoCode_*');
|
||||
$res &= Configuration::updateValue('PS_CURRENCY_DEFAULT', (int)Currency::getIdByIsoCode($this->iso_currency));
|
||||
Currency::refreshCurrencies();
|
||||
}
|
||||
|
||||
@@ -277,24 +277,31 @@ class MetaCore extends ObjectModel
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
WHERE cl.`id_lang` = '.(int)$id_lang.'
|
||||
AND cl.`id_category` = '.(int)$id_category.Shop::addSqlRestrictionOnLang('cl');
|
||||
if ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql))
|
||||
|
||||
$cache_id = 'Meta::getCategoryMetas'.(int)$id_category.'-'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
if (empty($row['meta_description']))
|
||||
$row['meta_description'] = strip_tags($row['description']);
|
||||
|
||||
// Paginate title
|
||||
if (!empty($row['meta_title']))
|
||||
$row['meta_title'] = $title.$row['meta_title'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
if ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql))
|
||||
{
|
||||
if (empty($row['meta_description']))
|
||||
$row['meta_description'] = strip_tags($row['description']);
|
||||
|
||||
// Paginate title
|
||||
if (!empty($row['meta_title']))
|
||||
$row['meta_title'] = $title.$row['meta_title'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
else
|
||||
$row['meta_title'] = $row['name'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
if (!empty($title))
|
||||
$row['meta_title'] = $title.(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
$result = Meta::completeMetaTags($row, $row['name']);
|
||||
}
|
||||
else
|
||||
$row['meta_title'] = $row['name'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
if (!empty($title))
|
||||
$row['meta_title'] = $title.(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
return Meta::completeMetaTags($row, $row['name']);
|
||||
$result = Meta::getHomeMetas($id_lang, $page_name);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
|
||||
return Meta::getHomeMetas($id_lang, $page_name);
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -191,7 +191,7 @@ abstract class ObjectModelCore
|
||||
if ($id)
|
||||
{
|
||||
// Load object from database if object id is present
|
||||
$cache_id = 'objectmodel_'.$this->def['classname'].'_'.(int)$id.'_'.(int)$id_shop.'_'.(int)$id_lang;
|
||||
$cache_id = 'objectmodel_'.$this->def['classname'].'_'.(int)$id.'_'.(int)$this->id_shop.'_'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = new DbQuery();
|
||||
@@ -1234,11 +1234,16 @@ abstract class ObjectModelCore
|
||||
if ($id_shop === null)
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
|
||||
$sql = 'SELECT id_shop
|
||||
FROM `'.pSQL(_DB_PREFIX_.$this->def['table']).'_shop`
|
||||
WHERE `'.$this->def['primary'].'` = '.(int)$this->id.'
|
||||
AND id_shop = '.(int)$id_shop;
|
||||
return (bool)Db::getInstance()->getValue($sql);
|
||||
$cache_id = 'objectmodel_shop_'.$this->def['classname'].'_'.(int)$this->id.'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT id_shop
|
||||
FROM `'.pSQL(_DB_PREFIX_.$this->def['table']).'_shop`
|
||||
WHERE `'.$this->def['primary'].'` = '.(int)$this->id.'
|
||||
AND id_shop = '.(int)$id_shop;
|
||||
Cache::store($cache_id, (bool)Db::getInstance()->getValue($sql));
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -229,7 +229,13 @@ class ProductCore extends ObjectModel
|
||||
protected static $_prices = array();
|
||||
protected static $_pricesLevel2 = array();
|
||||
protected static $_incat = array();
|
||||
|
||||
/**
|
||||
* @since 1.5.6.1
|
||||
* @var array $_cart_quantity is deprecated since 1.5.6.1
|
||||
*/
|
||||
protected static $_cart_quantity = array();
|
||||
|
||||
protected static $_tax_rules_group = array();
|
||||
protected static $_cacheFeatures = array();
|
||||
protected static $_frontFeaturesCache = array();
|
||||
@@ -2434,13 +2440,18 @@ class ProductCore extends ObjectModel
|
||||
{
|
||||
if (!$context)
|
||||
$context = Context::getContext();
|
||||
|
||||
$sql = 'SELECT image_shop.`id_image`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
'.Shop::addSqlAssociation('image', 'i').'
|
||||
WHERE i.`id_product` = '.(int)$id_product.'
|
||||
AND image_shop.`cover` = 1';
|
||||
return Db::getInstance()->getRow($sql);
|
||||
$cache_id = 'Product::getOrderStates_'.(int)$id_product.'-'.(int)$context->shop->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT image_shop.`id_image`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
'.Shop::addSqlAssociation('image', 'i').'
|
||||
WHERE i.`id_product` = '.(int)$id_product.'
|
||||
AND image_shop.`cover` = 1';
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2502,15 +2513,17 @@ class ProductCore extends ObjectModel
|
||||
$cart_quantity = 0;
|
||||
if ((int)$id_cart)
|
||||
{
|
||||
$condition = '';
|
||||
$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`)
|
||||
$cache_id = 'Product::getPriceStatic_'.(int)$id_product.'-'.(int)$id_cart;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT SUM(`quantity`)
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE `id_product` = '.(int)$id_product.'
|
||||
AND `id_cart` = '.(int)$id_cart);
|
||||
$cart_quantity = self::$_cart_quantity[$cache_name];
|
||||
AND `id_cart` = '.(int)$id_cart;
|
||||
$cart_quantity = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $cart_quantity);
|
||||
}
|
||||
$cart_quantity = Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
$id_currency = (int)Validate::isLoadedObject($context->currency) ? $context->currency->id : Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
@@ -4300,19 +4313,25 @@ class ProductCore extends ObjectModel
|
||||
|
||||
public function checkAccess($id_customer)
|
||||
{
|
||||
if (!$id_customer)
|
||||
return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND ctg.`id_group` ='.(int)Group::getCurrent()->id);
|
||||
else
|
||||
return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT cg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND cg.`id_customer` = '.(int)$id_customer);
|
||||
$cache_id = 'Product::checkAccess_'.(int)$this->id.'-'.(int)$id_customer.(!$id_customer ? '-'.(int)Group::getCurrent()->id : '');
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
if (!$id_customer)
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND ctg.`id_group` = '.(int)Group::getCurrent()->id);
|
||||
else
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT cg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND cg.`id_customer` = '.(int)$id_customer);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -4872,8 +4891,12 @@ class ProductCore extends ObjectModel
|
||||
*/
|
||||
public static function getAttributesParams($id_product, $id_product_attribute)
|
||||
{
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
$id_shop = (int)Context::getContext()->shop->id;
|
||||
$cache_id = 'Product::getAttributesParams_'.(int)$id_product.'-'.(int)$id_product_attribute.'-'.(int)$id_lang.'-'.(int)$id_shop;
|
||||
|
||||
// if blocklayered module is installed we check if user has set custom attribute name
|
||||
if (Module::isInstalled('blocklayered'))
|
||||
if (Module::isInstalled('blocklayered') && Module::isEnabled('blocklayered'))
|
||||
{
|
||||
$nb_custom_values = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT la.`id_attribute`, la.`url_name` as `name`
|
||||
@@ -4884,7 +4907,7 @@ class ProductCore extends ObjectModel
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'layered_indexable_attribute_lang_value` la
|
||||
ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE la.`url_name` IS NOT NULL AND la.`url_name` != \'\'
|
||||
AND pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.`id_product_attribute` = '.(int)$id_product_attribute);
|
||||
@@ -4902,7 +4925,7 @@ class ProductCore extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND g.`id_lang` = '.(int)$id_lang.'
|
||||
AND g.`url_name` IS NOT NULL AND g.`url_name` != \'\'');
|
||||
if (empty($group))
|
||||
{
|
||||
@@ -4912,7 +4935,7 @@ class ProductCore extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND g.`id_lang` = '.(int)$id_lang.'
|
||||
AND g.`name` IS NOT NULL');
|
||||
}
|
||||
$result[] = array_merge($attribute, $group[0]);
|
||||
@@ -4921,9 +4944,9 @@ class ProductCore extends ObjectModel
|
||||
SELECT DISTINCT a.`id_attribute_group`, al.`name`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
@@ -4932,45 +4955,30 @@ class ProductCore extends ObjectModel
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.id_product_attribute = '.(int)$id_product_attribute.'
|
||||
AND a.`id_attribute` NOT IN('.implode(', ', $tab_id_attribute).')');
|
||||
$result = array_merge($values_not_custom, $result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT al.`name`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (al.`id_attribute` = a.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (pac.`id_attribute` = a.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pa.`id_product_attribute` = pac.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.`id_product_attribute` = '.(int)$id_product_attribute.'
|
||||
AND agl.`id_lang` = '.(int)Context::getContext()->language->id);
|
||||
return array_merge($values_not_custom, $result);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT al.`name`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (al.`id_attribute` = a.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (al.`id_attribute` = a.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (pac.`id_attribute` = a.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pa.`id_product_attribute` = pac.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.`id_product_attribute` = '.(int)$id_product_attribute.'
|
||||
AND agl.`id_lang` = '.(int)Context::getContext()->language->id);
|
||||
AND agl.`id_lang` = '.(int)$id_lang);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
$result = Cache::retrieve($cache_id);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,6 @@ class ProductSaleCore
|
||||
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
|
||||
|
||||
//Main query
|
||||
if ($order_by == 'date_add')
|
||||
$sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity,
|
||||
pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`,
|
||||
pl.`meta_keywords`, pl.`meta_title`, pl.`name`,
|
||||
|
||||
@@ -80,13 +80,19 @@ class StateCore extends ObjectModel
|
||||
*/
|
||||
public static function getNameById($id_state)
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `name`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `id_state` = '.(int)$id_state
|
||||
);
|
||||
|
||||
return $result['name'];
|
||||
if (!$id_state)
|
||||
return false;
|
||||
$cache_id = 'State::getNameById_'.(int)$id_state;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `name`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `id_state` = '.(int)$id_state
|
||||
);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,13 +103,19 @@ class StateCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdByName($state)
|
||||
{
|
||||
$result = Db::getInstance()->getValue('
|
||||
SELECT `id_state`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `name` LIKE \''.pSQL($state).'\'
|
||||
');
|
||||
|
||||
return (int)$result;
|
||||
if (empty($state))
|
||||
return false;
|
||||
$cache_id = 'State::getNameById_'.pSQL($state);
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_state`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `name` LIKE \''.pSQL($state).'\'
|
||||
');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -190,14 +190,20 @@ class TabCore extends ObjectModel
|
||||
*/
|
||||
public static function getTab($id_lang, $id_tab)
|
||||
{
|
||||
/* Tabs selection */
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'tab` t
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab_lang` tl
|
||||
ON (t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE t.`id_tab` = '.(int)$id_tab
|
||||
);
|
||||
$cache_id = 'Tab::getTab_'.(int)$id_lang.'-'.(int)$id_tab;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
/* Tabs selection */
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'tab` t
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab_lang` tl
|
||||
ON (t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE t.`id_tab` = '.(int)$id_tab
|
||||
);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -346,17 +346,12 @@ class ToolsCore
|
||||
/* Automatically detect language if not already defined, detect_language is set in Cookie::update */
|
||||
if ((!$cookie->id_lang || isset($cookie->detect_language)) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
{
|
||||
$array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
|
||||
if (Tools::strlen($array[0]) > 2)
|
||||
$array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
|
||||
$string = $array[0];
|
||||
|
||||
if (Validate::isLanguageCode($string))
|
||||
{
|
||||
$tab = explode('-', $array[0]);
|
||||
$string = $tab[0];
|
||||
}
|
||||
else
|
||||
$string = $array[0];
|
||||
if (Validate::isLanguageIsoCode($string))
|
||||
{
|
||||
$lang = new Language(Language::getIdByIso($string));
|
||||
$lang = Language::getLanguageByIETFCode($string);
|
||||
if (Validate::isLoadedObject($lang) && $lang->active && $lang->isAssociatedToShop())
|
||||
{
|
||||
Context::getContext()->language = $lang;
|
||||
@@ -364,7 +359,7 @@ class ToolsCore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($cookie->detect_language))
|
||||
unset($cookie->detect_language);
|
||||
|
||||
@@ -374,7 +369,7 @@ class ToolsCore
|
||||
|
||||
$iso = Language::getIsoById((int)$cookie->id_lang);
|
||||
@include_once(_PS_THEME_DIR_.'lang/'.$iso.'.php');
|
||||
|
||||
|
||||
return $iso;
|
||||
}
|
||||
|
||||
@@ -689,9 +684,10 @@ class ToolsCore
|
||||
|
||||
public static function safePostVars()
|
||||
{
|
||||
if (!is_array($_POST))
|
||||
return array();
|
||||
$_POST = array_map(array('Tools', 'htmlentitiesUTF8'), $_POST);
|
||||
if (!isset($_POST) || !is_array($_POST))
|
||||
$_POST = array();
|
||||
else
|
||||
$_POST = array_map(array('Tools', 'htmlentitiesUTF8'), $_POST);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,12 +54,18 @@ class ZoneCore extends ObjectModel
|
||||
*/
|
||||
public static function getZones($active = false)
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'zone`
|
||||
'.($active ? 'WHERE active = 1' : '').'
|
||||
ORDER BY `name` ASC
|
||||
');
|
||||
$cache_id = 'Zone::getZones_'.(bool)$active;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'zone`
|
||||
'.($active ? 'WHERE active = 1' : '').'
|
||||
ORDER BY `name` ASC
|
||||
');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -523,13 +523,13 @@ abstract class DbCore
|
||||
$this->last_cached = true;
|
||||
return $result;
|
||||
}
|
||||
|
||||
$this->result = $this->query($sql);
|
||||
if (!$this->result)
|
||||
return false;
|
||||
|
||||
$this->last_cached = false;
|
||||
$result = $this->nextRow($this->result);
|
||||
if (is_null($result))
|
||||
$result = false;
|
||||
if ($use_cache && $this->is_cache_enabled)
|
||||
Cache::getInstance()->setQuery($sql, $result);
|
||||
return $result;
|
||||
|
||||
@@ -1864,7 +1864,13 @@ abstract class ModuleCore
|
||||
*/
|
||||
public static function getModuleIdByName($name)
|
||||
{
|
||||
return Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = "'.pSQL($name).'"');
|
||||
$cache_id = 'Module::getModuleIdByName_'.pSQL($name);
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = "'.pSQL($name).'"');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -721,11 +721,17 @@ class OrderCore extends ObjectModel
|
||||
|
||||
public static function getDiscountsCustomer($id_customer, $id_cart_rule)
|
||||
{
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT COUNT(*) FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN '._DB_PREFIX_.'order_cart_rule ocr ON (ocr.id_order = o.id_order)
|
||||
WHERE o.id_customer = '.(int)$id_customer.'
|
||||
AND ocr.id_cart_rule = '.(int)$id_cart_rule);
|
||||
$cache_id = 'Order::getDiscountsCustomer_'.(int)$id_customer.'-'.(int)$id_cart_rule;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('
|
||||
SELECT COUNT(*) FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN '._DB_PREFIX_.'order_cart_rule ocr ON (ocr.id_order = o.id_order)
|
||||
WHERE o.id_customer = '.(int)$id_customer.'
|
||||
AND ocr.id_cart_rule = '.(int)$id_cart_rule);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,12 +112,18 @@ class OrderStateCore extends ObjectModel
|
||||
*/
|
||||
public static function getOrderStates($id_lang)
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'order_state` os
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE deleted = 0
|
||||
ORDER BY `name` ASC');
|
||||
$cache_id = 'OrderState::getOrderStates_'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'order_state` os
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE deleted = 0
|
||||
ORDER BY `name` ASC');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -187,14 +187,19 @@ class ShopCore extends ObjectModel
|
||||
|
||||
public function setUrl()
|
||||
{
|
||||
$row = Db::getInstance()->getRow('
|
||||
SELECT su.physical_uri, su.virtual_uri, su.domain, su.domain_ssl, t.id_theme, t.name, t.directory
|
||||
FROM '._DB_PREFIX_.'shop s
|
||||
LEFT JOIN '._DB_PREFIX_.'shop_url su ON (s.id_shop = su.id_shop)
|
||||
LEFT JOIN '._DB_PREFIX_.'theme t ON (t.id_theme = s.id_theme)
|
||||
WHERE s.id_shop = '.(int)$this->id.'
|
||||
AND s.active = 1 AND s.deleted = 0 AND su.main = 1');
|
||||
|
||||
$cache_id = 'Shop::setUrl_'.(int)$this->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$row = Db::getInstance()->getRow('
|
||||
SELECT su.physical_uri, su.virtual_uri, su.domain, su.domain_ssl, t.id_theme, t.name, t.directory
|
||||
FROM '._DB_PREFIX_.'shop s
|
||||
LEFT JOIN '._DB_PREFIX_.'shop_url su ON (s.id_shop = su.id_shop)
|
||||
LEFT JOIN '._DB_PREFIX_.'theme t ON (t.id_theme = s.id_theme)
|
||||
WHERE s.id_shop = '.(int)$this->id.'
|
||||
AND s.active = 1 AND s.deleted = 0 AND su.main = 1');
|
||||
Cache::store($cache_id, $row);
|
||||
}
|
||||
$row = Cache::retrieve($cache_id);
|
||||
if (!$row)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ class StockAvailableCore extends ObjectModel
|
||||
/** @var bool determine if a product is out of stock - it was previously in Product class */
|
||||
public $out_of_stock = false;
|
||||
|
||||
protected static $cache_quantity_available;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -343,18 +345,23 @@ class StockAvailableCore extends ObjectModel
|
||||
if ($id_product_attribute === null)
|
||||
$id_product_attribute = 0;
|
||||
|
||||
$query = new DbQuery();
|
||||
$query->select('SUM(quantity)');
|
||||
$query->from('stock_available');
|
||||
$key = (int)$id_product.'-'.(int)$id_product_attribute.'-'.(int)$id_shop;
|
||||
if (!isset(self::$cache_quantity_available[$key]))
|
||||
{
|
||||
$query = new DbQuery();
|
||||
$query->select('SUM(quantity)');
|
||||
$query->from('stock_available');
|
||||
|
||||
// if null, it's a product without attributes
|
||||
if ($id_product !== null)
|
||||
$query->where('id_product = '.(int)$id_product);
|
||||
|
||||
$query->where('id_product_attribute = '.(int)$id_product_attribute);
|
||||
$query = StockAvailable::addSqlShopRestriction($query, $id_shop);
|
||||
|
||||
// if null, it's a product without attributes
|
||||
if ($id_product !== null)
|
||||
$query->where('id_product = '.(int)$id_product);
|
||||
|
||||
$query->where('id_product_attribute = '.(int)$id_product_attribute);
|
||||
$query = StockAvailable::addSqlShopRestriction($query, $id_shop);
|
||||
|
||||
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
|
||||
self::$cache_quantity_available[$key] = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
|
||||
}
|
||||
return self::$cache_quantity_available[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -124,9 +124,13 @@ class TaxRuleCore extends ObjectModel
|
||||
*/
|
||||
public static function isTaxInUse($id_tax)
|
||||
{
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT COUNT(*) FROM `'._DB_PREFIX_.'tax_rule` WHERE `id_tax` = '.(int)$id_tax
|
||||
);
|
||||
$cache_id = 'TaxRule::isTaxInUse_'.(int)$id_tax;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'tax_rule` WHERE `id_tax` = '.(int)$id_tax);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,9 +33,6 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface
|
||||
public $type;
|
||||
public $tax_calculator;
|
||||
|
||||
protected static $cache_tax_calculator;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Address $address
|
||||
@@ -80,7 +77,8 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface
|
||||
if (!empty($this->address->postcode))
|
||||
$postcode = $this->address->postcode;
|
||||
|
||||
if (!isset(self::$cache_tax_calculator[(int)$this->address->id_country.'-'.$postcode.'-'.$this->type]))
|
||||
$cache_id = (int)$this->address->id_country.'-'.(int)$this->address->id_state.'-'.$postcode.'-'.(int)$this->type;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$rows = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
@@ -110,11 +108,8 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface
|
||||
if ($row['behavior'] == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
self::$cache_tax_calculator[$postcode.'-'.$this->type] = new TaxCalculator($taxes, $behavior);
|
||||
Cache::store($cache_id, new TaxCalculator($taxes, $behavior));
|
||||
}
|
||||
|
||||
return self::$cache_tax_calculator[$postcode.'-'.$this->type];
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2660,6 +2660,10 @@ class AdminProductsControllerCore extends AdminController
|
||||
$product_supplier->id_product = $product->id;
|
||||
$product_supplier->id_product_attribute = 0;
|
||||
$product_supplier->id_supplier = $id;
|
||||
if ($this->context->currency->id)
|
||||
$product_supplier->id_currency = (int)$this->context->currency->id;
|
||||
else
|
||||
$product_supplier->id_currency = (int)Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
$product_supplier->save();
|
||||
|
||||
$associated_suppliers[] = $product_supplier;
|
||||
|
||||
@@ -30,12 +30,13 @@ class CmsControllerCore extends FrontController
|
||||
public $assignCase;
|
||||
public $cms;
|
||||
public $cms_category;
|
||||
public $ssl = false;
|
||||
|
||||
public function canonicalRedirection($canonicalURL = '')
|
||||
{
|
||||
if (Tools::getValue('live_edit'))
|
||||
return ;
|
||||
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms)))
|
||||
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms, $this->cms->link_rewrite, $this->ssl)))
|
||||
parent::canonicalRedirection($canonicalURL);
|
||||
else if (Validate::isLoadedObject($this->cms_category) && ($canonicalURL = $this->context->link->getCMSCategoryLink($this->cms_category)))
|
||||
parent::canonicalRedirection($canonicalURL);
|
||||
@@ -47,13 +48,16 @@ class CmsControllerCore extends FrontController
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
if ($id_cms = (int)Tools::getValue('id_cms'))
|
||||
$this->cms = new CMS($id_cms, $this->context->language->id);
|
||||
else if ($id_cms_category = (int)Tools::getValue('id_cms_category'))
|
||||
$this->cms_category = new CMSCategory($id_cms_category, $this->context->language->id);
|
||||
|
||||
if (Configuration::get('PS_SSL_ENABLED') && Tools::getValue('content_only') && Tools::getValue('id_cms') == (int)Configuration::get('PS_CONDITIONS_CMS_ID') && Validate::isLoadedObject($this->cms))
|
||||
$this->ssl = true;
|
||||
|
||||
parent::init();
|
||||
|
||||
$this->canonicalRedirection();
|
||||
|
||||
// assignCase (1 = CMS page, 2 = CMS category)
|
||||
@@ -120,7 +124,7 @@ class CmsControllerCore extends FrontController
|
||||
'category' => $this->cms_category, //for backward compatibility
|
||||
'cms_category' => $this->cms_category,
|
||||
'sub_category' => $this->cms_category->getSubCategories($this->context->language->id),
|
||||
'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)($this->cms_category->id) ),
|
||||
'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)($this->cms_category->id), true, (int)$this->context->shop->id),
|
||||
'path' => ($this->cms_category->id !== 1) ? Tools::getPath($this->cms_category->id, $this->cms_category->name, false, 'CMS') : '',
|
||||
));
|
||||
}
|
||||
|
||||
@@ -415,6 +415,17 @@ class ParentOrderControllerCore extends FrontController
|
||||
if (key($customerAddresses) != 0)
|
||||
$customerAddresses = array_values($customerAddresses);
|
||||
|
||||
if (!count($customerAddresses))
|
||||
{
|
||||
$bad_delivery = false;
|
||||
if (($bad_delivery = (bool)!Address::isCountryActiveById((int)$this->context->cart->id_address_delivery)) || (!Address::isCountryActiveById((int)$this->context->cart->id_address_invoice)))
|
||||
{
|
||||
$back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, array('step' => Tools::getValue('step'), 'multi-shipping' => (int)Tools::getValue('multi-shipping')));
|
||||
$params = array('multi-shipping' => (int)Tools::getValue('multi-shipping'), 'id_address' => ($bad_delivery ? (int)$this->context->cart->id_address_delivery : (int)$this->context->cart->id_address_invoice), 'back' => $back_url);
|
||||
Tools::redirect($this->context->link->getPageLink('address', true, (int)$this->context->language->id, $params));
|
||||
}
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'addresses' => $customerAddresses,
|
||||
'formatedAddressFieldsValuesList' => $formatedAddressFieldsValuesList));
|
||||
@@ -465,16 +476,6 @@ class ParentOrderControllerCore extends FrontController
|
||||
$address = new Address($this->context->cart->id_address_delivery);
|
||||
$id_zone = Address::getZoneById($address->id);
|
||||
$bad_delivery = false;
|
||||
if (($bad_delivery = (bool)!Address::isCountryActiveById((int)$this->context->cart->id_address_delivery)) || (!Address::isCountryActiveById((int)$this->context->cart->id_address_invoice)))
|
||||
{
|
||||
if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 1 && Dispatcher::getInstance()->getController() != 'order-opc')
|
||||
{
|
||||
$back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, array('step' => Tools::getValue('step'), 'multi-shipping' => (int)Tools::getValue('multi-shipping')));
|
||||
$params = array('multi-shipping' => (int)Tools::getValue('multi-shipping'), 'id_address' => ($bad_delivery ? (int)$this->context->cart->id_address_delivery : (int)$this->context->cart->id_address_invoice), 'back' => $back_url);
|
||||
Tools::redirect($this->context->link->getPageLink('address', true, (int)$this->context->language->id, $params));
|
||||
}
|
||||
Tools::redirect('index.php?controller=order&step=1');
|
||||
}
|
||||
$carriers = $this->context->cart->simulateCarriersOutput();
|
||||
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
||||
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
||||
@@ -510,7 +511,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);
|
||||
$this->link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, (bool)Configuration::get('PS_SSL_ENABLED'));
|
||||
if (!strpos($this->link_conditions, '?'))
|
||||
$this->link_conditions .= '?content_only=1';
|
||||
else
|
||||
|
||||
@@ -548,7 +548,7 @@ class ProductControllerCore extends FrontController
|
||||
$path = Tools::getPath((int)$this->context->shop->id_category, $this->product->name);
|
||||
$this->context->smarty->assign('path', $path);
|
||||
|
||||
$this->context->smarty->assign('categories', Category::getHomeCategories($this->context->language->id));
|
||||
$this->context->smarty->assign('categories', Category::getHomeCategories($this->context->language->id, true, (int)$this->context->shop->id));
|
||||
$this->context->smarty->assign(array('HOOK_PRODUCT_FOOTER' => Hook::exec('displayFooterProduct', array('product' => $this->product, 'category' => $this->category))));
|
||||
}
|
||||
|
||||
|
||||
@@ -279,6 +279,6 @@ class StoresControllerCore extends FrontController
|
||||
if (!Configuration::get('PS_STORES_SIMPLIFIED'))
|
||||
$this->addJS(_THEME_JS_DIR_.'stores.js');
|
||||
$default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
$this->addJS('http://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));
|
||||
$this->addJS('http'.((Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE')) ? 's' : '').'://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));
|
||||
}
|
||||
}
|
||||
|
||||
5
docs/csv_import/alias_import.csv
Normal file
5
docs/csv_import/alias_import.csv
Normal file
@@ -0,0 +1,5 @@
|
||||
id;Alias *;Search *;Active (0/1)
|
||||
1;ano, anno, nona;nano;1
|
||||
2;ipdo, idop, podi;ipod;1
|
||||
3;McBook, Mbcook;MacBook;1
|
||||
4;Blekin;Belkin;1
|
||||
|
|
Can't render this file because it contains an unexpected character in line 2 and column 718.
|
@@ -136,7 +136,10 @@ class InstallLanguages
|
||||
}
|
||||
|
||||
$args[0] = $translation;
|
||||
return call_user_func_array('sprintf', $args);
|
||||
if(count($args) > 1)
|
||||
return call_user_func_array('sprintf', $args);
|
||||
else
|
||||
return $translation;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,39 +8,39 @@
|
||||
<field name="product_supplier_price_te"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<product_supplier id="product_supplier_1" id_product="iPod_Nano" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_2" id_product="iPod_Nano" id_product_attribute="product_attribute_25" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_3" id_product="iPod_Nano" id_product_attribute="product_attribute_26" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_4" id_product="iPod_Nano" id_product_attribute="product_attribute_27" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_5" id_product="iPod_Nano" id_product_attribute="product_attribute_28" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_6" id_product="iPod_Nano" id_product_attribute="product_attribute_29" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_7" id_product="iPod_Nano" id_product_attribute="product_attribute_30" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_8" id_product="iPod_Nano" id_product_attribute="product_attribute_31" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_9" id_product="iPod_Nano" id_product_attribute="product_attribute_32" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_10" id_product="iPod_Nano" id_product_attribute="product_attribute_33" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_11" id_product="iPod_Nano" id_product_attribute="product_attribute_34" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_12" id_product="iPod_Nano" id_product_attribute="product_attribute_35" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_13" id_product="iPod_Nano" id_product_attribute="product_attribute_36" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_14" id_product="iPod_Nano" id_product_attribute="product_attribute_39" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_15" id_product="iPod_Nano" id_product_attribute="product_attribute_40" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_16" id_product="iPod_Nano" id_product_attribute="product_attribute_41" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_17" id_product="iPod_Nano" id_product_attribute="product_attribute_42" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_18" id_product="MacBook_Air" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_19" id_product="MacBook_Air" id_product_attribute="product_attribute_12" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_20" id_product="MacBook_Air" id_product_attribute="product_attribute_13" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_21" id_product="MacBook_Air" id_product_attribute="product_attribute_14" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_22" id_product="MacBook_Air" id_product_attribute="product_attribute_15" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_23" id_product="Belkin_Leather_Folio_for_iPod_nano_-_Black_Chocolate" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_24" id_product="iPod_shuffle" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_25" id_product="iPod_shuffle" id_product_attribute="product_attribute_7" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_26" id_product="iPod_shuffle" id_product_attribute="product_attribute_8" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_27" id_product="iPod_shuffle" id_product_attribute="product_attribute_9" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_28" id_product="iPod_shuffle" id_product_attribute="product_attribute_10" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_30" id_product="MacBook" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_31" id_product="iPod_touch" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_32" id_product="iPod_touch" id_product_attribute="product_attribute_19" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_33" id_product="iPod_touch" id_product_attribute="product_attribute_22" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_34" id_product="iPod_touch" id_product_attribute="product_attribute_23" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_35" id_product="Shure_SE210_Sound-Isolating_Earphones_for_iPod_and_iPhone" id_product_attribute="" id_supplier="Shure_Online_Store" product_supplier_reference="" product_supplier_price_te="0.000000"/>
|
||||
<product_supplier id="product_supplier_1" id_product="iPod_Nano" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_2" id_product="iPod_Nano" id_product_attribute="product_attribute_25" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_3" id_product="iPod_Nano" id_product_attribute="product_attribute_26" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_4" id_product="iPod_Nano" id_product_attribute="product_attribute_27" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_5" id_product="iPod_Nano" id_product_attribute="product_attribute_28" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_6" id_product="iPod_Nano" id_product_attribute="product_attribute_29" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_7" id_product="iPod_Nano" id_product_attribute="product_attribute_30" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_8" id_product="iPod_Nano" id_product_attribute="product_attribute_31" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_9" id_product="iPod_Nano" id_product_attribute="product_attribute_32" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_10" id_product="iPod_Nano" id_product_attribute="product_attribute_33" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_11" id_product="iPod_Nano" id_product_attribute="product_attribute_34" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_12" id_product="iPod_Nano" id_product_attribute="product_attribute_35" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_13" id_product="iPod_Nano" id_product_attribute="product_attribute_36" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_14" id_product="iPod_Nano" id_product_attribute="product_attribute_39" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_15" id_product="iPod_Nano" id_product_attribute="product_attribute_40" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_16" id_product="iPod_Nano" id_product_attribute="product_attribute_41" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_17" id_product="iPod_Nano" id_product_attribute="product_attribute_42" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_18" id_product="MacBook_Air" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_19" id_product="MacBook_Air" id_product_attribute="product_attribute_12" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_20" id_product="MacBook_Air" id_product_attribute="product_attribute_13" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_21" id_product="MacBook_Air" id_product_attribute="product_attribute_14" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_22" id_product="MacBook_Air" id_product_attribute="product_attribute_15" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_23" id_product="Belkin_Leather_Folio_for_iPod_nano_-_Black_Chocolate" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_24" id_product="iPod_shuffle" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_25" id_product="iPod_shuffle" id_product_attribute="product_attribute_7" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_26" id_product="iPod_shuffle" id_product_attribute="product_attribute_8" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_27" id_product="iPod_shuffle" id_product_attribute="product_attribute_9" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_28" id_product="iPod_shuffle" id_product_attribute="product_attribute_10" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_30" id_product="MacBook" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_31" id_product="iPod_touch" id_product_attribute="" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_32" id_product="iPod_touch" id_product_attribute="product_attribute_19" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_33" id_product="iPod_touch" id_product_attribute="product_attribute_22" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_34" id_product="iPod_touch" id_product_attribute="product_attribute_23" id_supplier="AppleStore" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
<product_supplier id="product_supplier_35" id_product="Shure_SE210_Sound-Isolating_Earphones_for_iPod_and_iPhone" id_product_attribute="" id_supplier="Shure_Online_Store" product_supplier_reference="" product_supplier_price_te="0.000000" id_currency="1"/>
|
||||
</entities>
|
||||
</entity_product_supplier>
|
||||
|
||||
@@ -8,4 +8,6 @@ UPDATE `PREFIX_orders` SET conversion_rate = 1 WHERE conversion_rate = 0;
|
||||
|
||||
ALTER TABLE `PREFIX_cms` ADD `indexation` tinyint(1) UNSIGNED NULL DEFAULT '1' AFTER `active`;
|
||||
|
||||
/* PHP:update_order_messages(); */;
|
||||
/* PHP:update_order_messages(); */;
|
||||
|
||||
ALTER TABLE `REFIX_group_reduction` CHANGE `reduction` `reduction` DECIMAL( 4, 4 ) NOT NULL;
|
||||
@@ -393,7 +393,7 @@ function showFees()
|
||||
//enable only if zone is active
|
||||
tr = $(this).parent('tr');
|
||||
validate = $('tr.fees_all td:eq('+$(this).index()+')').hasClass('validated');
|
||||
if ($(tr).index() > 2 && $(tr).find('td:eq(1) input').attr('checked') && validate || !$(tr).hasClass('range_sup') || !$(tr).hasClass('range_inf'))
|
||||
if ($(tr).index() > 2 && $(tr).find('td:eq(1) input').prop('checked') && (validate || !$(tr).hasClass('range_sup') || !$(tr).hasClass('range_inf')))
|
||||
$(this).find('input:text').removeAttr('disabled');
|
||||
|
||||
$(this).find('input:text, button').css('background-color', '').css('border-color', '');
|
||||
|
||||
@@ -201,4 +201,59 @@
|
||||
<unit type="base_distance" value="m" />
|
||||
<unit type="long_distance" value="km" />
|
||||
</units>
|
||||
|
||||
<state>
|
||||
<state name="Άγιο Όρος" iso_code="GR-69" country="GR" zone="Europe"/>
|
||||
<state name="Αιτωλοακαρνανίας" iso_code="GR-01" country="GR" zone="Europe"/>
|
||||
<state name="Αργολίδας" iso_code="GR-11" country="GR" zone="Europe"/>
|
||||
<state name="Αρκαδίας" iso_code="GR-12" country="GR" zone="Europe"/>
|
||||
<state name="Άρτας" iso_code="GR-31" country="GR" zone="Europe"/>
|
||||
<state name="Αττικής" iso_code="GR-A1" country="GR" zone="Europe"/>
|
||||
<state name="Αχαΐας" iso_code="GR-13" country="GR" zone="Europe"/>
|
||||
<state name="Βοιωτίας" iso_code="GR-03" country="GR" zone="Europe"/>
|
||||
<state name="Γρεβενών" iso_code="GR-51" country="GR" zone="Europe"/>
|
||||
<state name="Δράμας" iso_code="GR-52" country="GR" zone="Europe"/>
|
||||
<state name="Δωδεκανήσου" iso_code="GR-81" country="GR" zone="Europe"/>
|
||||
<state name="Ευρυτανίας" iso_code="GR-05" country="GR" zone="Europe"/>
|
||||
<state name="Εύβοιας" iso_code="GR-04" country="GR" zone="Europe"/>
|
||||
<state name="Έβρου" iso_code="GR-71" country="GR" zone="Europe"/>
|
||||
<state name="Ζακύνθου" iso_code="GR-21" country="GR" zone="Europe"/>
|
||||
<state name="Ηλείας" iso_code="GR-14" country="GR" zone="Europe"/>
|
||||
<state name="Ημαθίας" iso_code="GR-53" country="GR" zone="Europe"/>
|
||||
<state name="Ηρακλείου" iso_code="GR-91" country="GR" zone="Europe"/>
|
||||
<state name="Θεσπρωτίας" iso_code="GR-32" country="GR" zone="Europe"/>
|
||||
<state name="Θεσσαλονίκης" iso_code="GR-54" country="GR" zone="Europe"/>
|
||||
<state name="Ιωαννίνων" iso_code="GR-33" country="GR" zone="Europe"/>
|
||||
<state name="Κέρκυρας" iso_code="GR-22" country="GR" zone="Europe"/>
|
||||
<state name="Καβάλας" iso_code="GR-55" country="GR" zone="Europe"/>
|
||||
<state name="Καρδίτσας" iso_code="GR-41" country="GR" zone="Europe"/>
|
||||
<state name="Καστοριάς" iso_code="GR-56" country="GR" zone="Europe"/>
|
||||
<state name="Κεφαλληνίας" iso_code="GR-23" country="GR" zone="Europe"/>
|
||||
<state name="Κιλκίς" iso_code="GR-57" country="GR" zone="Europe"/>
|
||||
<state name="Κοζάνης" iso_code="GR-58" country="GR" zone="Europe"/>
|
||||
<state name="Κορινθίας" iso_code="GR-15" country="GR" zone="Europe"/>
|
||||
<state name="Κυκλάδων" iso_code="GR-82" country="GR" zone="Europe"/>
|
||||
<state name="Λάρισας" iso_code="GR-42" country="GR" zone="Europe"/>
|
||||
<state name="Λέσβου" iso_code="GR-83" country="GR" zone="Europe"/>
|
||||
<state name="Λακωνίας" iso_code="GR-16" country="GR" zone="Europe"/>
|
||||
<state name="Λασιθίου" iso_code="GR-92" country="GR" zone="Europe"/>
|
||||
<state name="Λευκάδας" iso_code="GR-24" country="GR" zone="Europe"/>
|
||||
<state name="Μαγνησίας" iso_code="GR-43" country="GR" zone="Europe"/>
|
||||
<state name="Μεσσηνίας" iso_code="GR-17" country="GR" zone="Europe"/>
|
||||
<state name="Ξάνθης" iso_code="GR-72" country="GR" zone="Europe"/>
|
||||
<state name="Πέλλας" iso_code="GR-59" country="GR" zone="Europe"/>
|
||||
<state name="Πιερίας" iso_code="GR-61" country="GR" zone="Europe"/>
|
||||
<state name="Πρέβεζας" iso_code="GR-34" country="GR" zone="Europe"/>
|
||||
<state name="Ρεθύμνου" iso_code="GR-93" country="GR" zone="Europe"/>
|
||||
<state name="Ροδόπης" iso_code="GR-73" country="GR" zone="Europe"/>
|
||||
<state name="Σάμου" iso_code="GR-84" country="GR" zone="Europe"/>
|
||||
<state name="Σερρών" iso_code="GR-62" country="GR" zone="Europe"/>
|
||||
<state name="Τρικάλων" iso_code="GR-44" country="GR" zone="Europe"/>
|
||||
<state name="Φθιώτιδας" iso_code="GR-06" country="GR" zone="Europe"/>
|
||||
<state name="Φλώρινας" iso_code="GR-63" country="GR" zone="Europe"/>
|
||||
<state name="Φωκίδας" iso_code="GR-07" country="GR" zone="Europe"/>
|
||||
<state name="Χίου" iso_code="GR-85" country="GR" zone="Europe"/>
|
||||
<state name="Χαλκιδικής" iso_code="GR-64" country="GR" zone="Europe"/>
|
||||
<state name="Χανίων" iso_code="GR-94" country="GR" zone="Europe"/>
|
||||
</state>
|
||||
</localizationPack>
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
{foreach from=$datas key='index' item='data' name='datas'}
|
||||
{ldelim}
|
||||
"index": {$index},
|
||||
"value": "{$data.value|addslashes|replace: '\\\'':'\''}",
|
||||
"truncatedValue": "{$data.value|truncate:28:'...'|addslashes|replace: '\\\'':'\''}"
|
||||
"value": "{Tools::nl2br($data.value|addslashes|replace: '\\\'':'\'')}",
|
||||
"truncatedValue": "{Tools::nl2br($data.value|truncate:28:'...'|addslashes|replace: '\\\'':'\'')}"
|
||||
{rdelim}{if !$smarty.foreach.datas.last},{/if}
|
||||
{/foreach}]
|
||||
{rdelim}{if !$smarty.foreach.customization.last},{/if}
|
||||
|
||||
@@ -230,12 +230,11 @@ function initLayered()
|
||||
|
||||
function paginationButton() {
|
||||
$('#pagination a').not(':hidden').each(function () {
|
||||
if ($(this).attr('href').search(/&|\?p=/) == -1) {
|
||||
var page = 1;
|
||||
}
|
||||
else {
|
||||
var page = $(this).attr('href').replace(/^.*[&|\?]p=(\d+).*$/, '$1');
|
||||
}
|
||||
if ($(this).attr('href').search(/[&|\?]p=/) == -1)
|
||||
var page = 1;
|
||||
else
|
||||
var page = $(this).attr('href').replace(/^.*[&|\?]p=(\d+).*$/, '$1');
|
||||
|
||||
var location = window.location.href.replace(/#.*$/, '');
|
||||
$(this).attr('href', location+current_friendly_url.replace(/\/page-(\d+)/, '')+'/page-'+page);
|
||||
});
|
||||
|
||||
@@ -572,7 +572,7 @@ class Blocktopmenu extends Module
|
||||
switch (substr($item, 0, strlen($value[1])))
|
||||
{
|
||||
case 'CAT':
|
||||
$this->getCategory((int)$id);
|
||||
$this->getCategory($id, $id_lang, $id_shop);
|
||||
break;
|
||||
|
||||
case 'PRD':
|
||||
@@ -687,9 +687,7 @@ class Blocktopmenu extends Module
|
||||
|
||||
if (isset($children) && count($children))
|
||||
foreach ($children as $child)
|
||||
{
|
||||
$this->getCategoryOption((int)$child['id_category'], (int)$id_lang, (int)$child['id_shop']);
|
||||
}
|
||||
}
|
||||
|
||||
private function getCategory($id_category, $id_lang = false, $id_shop = false)
|
||||
|
||||
@@ -171,6 +171,8 @@ class WishList extends ObjectModel
|
||||
*/
|
||||
public static function getByIdCustomer($id_customer)
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_customer))
|
||||
die (Tools::displayError());
|
||||
if (Shop::getContextShopID())
|
||||
$shop_restriction = 'AND id_shop = '.(int)Shop::getContextShopID();
|
||||
elseif (Shop::getContextShopGroupID())
|
||||
@@ -178,14 +180,18 @@ class WishList extends ObjectModel
|
||||
else
|
||||
$shop_restriction = '';
|
||||
|
||||
if (!Validate::isUnsignedId($id_customer))
|
||||
die (Tools::displayError());
|
||||
return (Db::getInstance()->executeS('
|
||||
SELECT w.`id_wishlist`, w.`name`, w.`token`, w.`date_add`, w.`date_upd`, w.`counter`
|
||||
FROM `'._DB_PREFIX_.'wishlist` w
|
||||
WHERE `id_customer` = '.(int)($id_customer).'
|
||||
'.$shop_restriction.'
|
||||
ORDER BY w.`name` ASC'));
|
||||
$cache_id = 'WhishList::getByIdCustomer_'.(int)$id_customer.'-'.(int)Shop::getContextShopID().'-'.(int)Shop::getContextShopGroupID();
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT w.`id_wishlist`, w.`name`, w.`token`, w.`date_add`, w.`date_upd`, w.`counter`
|
||||
FROM `'._DB_PREFIX_.'wishlist` w
|
||||
WHERE `id_customer` = '.(int)($id_customer).'
|
||||
'.$shop_restriction.'
|
||||
ORDER BY w.`name` ASC');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public static function refreshWishList($id_wishlist)
|
||||
|
||||
@@ -58,7 +58,7 @@ function WishlistCart(id, action, id_product, id_product_attribute, quantity)
|
||||
if($('#' + id).length != 0)
|
||||
{
|
||||
$('#' + id).slideUp('normal');
|
||||
document.getElementById(id).innerHTML = data;
|
||||
$('#' + id).html(data);
|
||||
$('#' + id).slideDown('normal');
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ function WishlistChangeDefault(id, id_wishlist)
|
||||
success: function(data)
|
||||
{
|
||||
$('#' + id).slideUp('normal');
|
||||
document.getElementById(id).innerHTML = data;
|
||||
$('#' + id).html(data);
|
||||
$('#' + id).slideDown('normal');
|
||||
}
|
||||
});
|
||||
@@ -147,7 +147,7 @@ function WishlistManage(id, id_wishlist)
|
||||
success: function(data)
|
||||
{
|
||||
$('#' + id).hide();
|
||||
document.getElementById(id).innerHTML = data;
|
||||
$('#' + id).html(data);
|
||||
$('#' + id).fadeIn('slow');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -43,9 +43,6 @@ class CrossSelling extends Module
|
||||
|
||||
$this->displayName = $this->l('Cross Selling');
|
||||
$this->description = $this->l('Customers who bought this product also bought:');
|
||||
|
||||
if (!$this->isRegisteredInHook('header'))
|
||||
$this->registerHook('header');
|
||||
}
|
||||
|
||||
public function install()
|
||||
|
||||
11
modules/crossselling/upgrade/install-0.8.php
Normal file
11
modules/crossselling/upgrade/install-0.8.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_0_8($object)
|
||||
{
|
||||
if (!$object->isRegisteredInHook('header'))
|
||||
return $object->registerHook('header');
|
||||
return true;
|
||||
}
|
||||
@@ -101,9 +101,9 @@ class LoyaltyModule extends ObjectModel
|
||||
{
|
||||
$cartProductsNew['id_product'] = (int)$newProduct->id;
|
||||
if ($taxesEnabled == PS_TAX_EXC)
|
||||
$cartProductsNew['price'] = number_format($newProduct->getPrice(false, (int)$newProduct->getDefaultIdProductAttribute()), 2, '.', '');
|
||||
$cartProductsNew['price'] = number_format($newProduct->getPrice(false, (int)$newProduct->getIdProductAttributeMostExpensive()), 2, '.', '');
|
||||
else
|
||||
$cartProductsNew['price_wt'] = number_format($newProduct->getPrice(true, (int)$newProduct->getDefaultIdProductAttribute()), 2, '.', '');
|
||||
$cartProductsNew['price_wt'] = number_format($newProduct->getPrice(true, (int)$newProduct->getIdProductAttributeMostExpensive()), 2, '.', '');
|
||||
$cartProductsNew['cart_quantity'] = 1;
|
||||
$cartProducts[] = $cartProductsNew;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>loyalty</name>
|
||||
<displayName><![CDATA[Customer loyalty and rewards]]></displayName>
|
||||
<displayName><![CDATA[Programme de fidélité]]></displayName>
|
||||
<version><![CDATA[1.9]]></version>
|
||||
<description><![CDATA[Provide a loyalty program to your customers.]]></description>
|
||||
<description><![CDATA[Propose un programme de fidélité à vos clients]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[pricing_promotion]]></tab>
|
||||
<confirmUninstall>Are you sure you want to delete all loyalty points and customer history?</confirmUninstall>
|
||||
<confirmUninstall>Cette action effacera tous les points de fidélité et l'historique des points de tous vos clients, êtes vous sûr ?</confirmUninstall>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
|
||||
@@ -453,7 +453,7 @@ class Loyalty extends Module
|
||||
$points = (int)LoyaltyModule::getNbPointsByPrice(
|
||||
$product->getPrice(
|
||||
Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true,
|
||||
(int)$product->getDefaultIdProductAttribute()
|
||||
(int)$product->getIdProductAttributeMostExpensive()
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ $(document).ready(function() {
|
||||
if (typeof(productPrice) == 'undefined' || typeof(productPriceWithoutReduction) == 'undefined')
|
||||
return;
|
||||
|
||||
var points = Math.round(productPrice / point_rate);
|
||||
var points = {$points};
|
||||
var total_points = points_in_cart + points;
|
||||
var voucher = total_points * point_value;
|
||||
if (!none_award && productPriceWithoutReduction != productPrice) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>mailalerts</name>
|
||||
<displayName><![CDATA[Mail alerts]]></displayName>
|
||||
<version><![CDATA[2.7]]></version>
|
||||
<version><![CDATA[2.8]]></version>
|
||||
<description><![CDATA[Sends e-mail notifications to customers and merchants.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[administration]]></tab>
|
||||
|
||||
@@ -46,7 +46,7 @@ class MailAlerts extends Module
|
||||
{
|
||||
$this->name = 'mailalerts';
|
||||
$this->tab = 'administration';
|
||||
$this->version = '2.7';
|
||||
$this->version = '2.8';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
@@ -383,7 +383,7 @@ class MailAlerts extends Module
|
||||
'{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',
|
||||
'{invoice_phone}' => $invoice->phone ? $invoice->phone : $invoice->phone_mobile,
|
||||
'{invoice_other}' => $invoice->other,
|
||||
'{order_name}' => sprintf('%06d', $order->id),
|
||||
'{order_name}' => $order->reference,
|
||||
'{shop_name}' => $configuration['PS_SHOP_NAME'],
|
||||
'{date}' => $order_date_text,
|
||||
'{carrier}' => (($carrier->name == '0') ? $configuration['PS_SHOP_NAME'] : $carrier->name),
|
||||
|
||||
@@ -97,18 +97,24 @@ class ProductComment extends ObjectModel
|
||||
if ($n != null && $n <= 0)
|
||||
$n = 5;
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT pc.`id_product_comment`,
|
||||
(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_usefulness` pcu WHERE pcu.`id_product_comment` = pc.`id_product_comment` AND pcu.`usefulness` = 1) as total_useful,
|
||||
(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_usefulness` pcu WHERE pcu.`id_product_comment` = pc.`id_product_comment`) as total_advice, '.
|
||||
((int)$id_customer ? '(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_usefulness` pcuc WHERE pcuc.`id_product_comment` = pc.`id_product_comment` AND pcuc.id_customer = '.(int)$id_customer.') as customer_advice, ' : '').
|
||||
((int)$id_customer ? '(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_report` pcrc WHERE pcrc.`id_product_comment` = pc.`id_product_comment` AND pcrc.id_customer = '.(int)$id_customer.') as customer_report, ' : '').'
|
||||
IF(c.id_customer, CONCAT(c.`firstname`, \' \', LEFT(c.`lastname`, 1)), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pc.title
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = pc.`id_customer`
|
||||
WHERE pc.`id_product` = '.(int)($id_product).($validate == '1' ? ' AND pc.`validate` = 1' : '').'
|
||||
ORDER BY pc.`date_add` DESC
|
||||
'.($n ? 'LIMIT '.(int)(($p - 1) * $n).', '.(int)($n) : ''));
|
||||
$cache_id = 'ProductComment::getByProduct_'.(int)$id_product.'-'.(int)$p.'-'.(int)$n.'-'.(int)$id_customer.'-'.(bool)$validate;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT pc.`id_product_comment`,
|
||||
(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_usefulness` pcu WHERE pcu.`id_product_comment` = pc.`id_product_comment` AND pcu.`usefulness` = 1) as total_useful,
|
||||
(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_usefulness` pcu WHERE pcu.`id_product_comment` = pc.`id_product_comment`) as total_advice, '.
|
||||
((int)$id_customer ? '(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_usefulness` pcuc WHERE pcuc.`id_product_comment` = pc.`id_product_comment` AND pcuc.id_customer = '.(int)$id_customer.') as customer_advice, ' : '').
|
||||
((int)$id_customer ? '(SELECT count(*) FROM `'._DB_PREFIX_.'product_comment_report` pcrc WHERE pcrc.`id_product_comment` = pc.`id_product_comment` AND pcrc.id_customer = '.(int)$id_customer.') as customer_report, ' : '').'
|
||||
IF(c.id_customer, CONCAT(c.`firstname`, \' \', LEFT(c.`lastname`, 1)), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pc.title
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = pc.`id_customer`
|
||||
WHERE pc.`id_product` = '.(int)($id_product).($validate == '1' ? ' AND pc.`validate` = 1' : '').'
|
||||
ORDER BY pc.`date_add` DESC
|
||||
'.($n ? 'LIMIT '.(int)(($p - 1) * $n).', '.(int)($n) : ''));
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,18 +124,24 @@ class ProductComment extends ObjectModel
|
||||
*/
|
||||
public static function getByCustomer($id_product, $id_customer, $get_last = false, $id_guest = false)
|
||||
{
|
||||
$results = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
WHERE pc.`id_product` = '.(int)$id_product.'
|
||||
AND '.(!$id_guest ? 'pc.`id_customer` = '.(int)$id_customer : 'pc.`id_guest` = '.(int)$id_guest).'
|
||||
ORDER BY pc.`date_add` DESC '
|
||||
.($get_last ? 'LIMIT 1' : '')
|
||||
);
|
||||
$cache_id = 'ProductComment::getByCustomer_'.(int)$id_product.'-'.(int)$id_customer.'-'.(bool)$get_last.'-'.(int)$id_guest;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$results = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
WHERE pc.`id_product` = '.(int)$id_product.'
|
||||
AND '.(!$id_guest ? 'pc.`id_customer` = '.(int)$id_customer : 'pc.`id_guest` = '.(int)$id_guest).'
|
||||
ORDER BY pc.`date_add` DESC '
|
||||
.($get_last ? 'LIMIT 1' : '')
|
||||
);
|
||||
|
||||
if ($get_last)
|
||||
$results = array_shift($results);
|
||||
return $results;
|
||||
if ($get_last && count($results))
|
||||
$results = array_shift($results);
|
||||
|
||||
Cache::store($cache_id, $results);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,12 +214,16 @@ class ProductComment extends ObjectModel
|
||||
if (!Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
$validate = (int)Configuration::get('PRODUCT_COMMENTS_MODERATE');
|
||||
if (($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT COUNT(`id_product_comment`) AS "nbr"
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
WHERE `id_product` = '.(int)($id_product).($validate == '1' ? ' AND `validate` = 1' : ''))) === false)
|
||||
return false;
|
||||
return (int)($result['nbr']);
|
||||
$cache_id = 'ProductComment::getCommentNumber_'.(int)$id_product.'-'.$validate;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT COUNT(`id_product_comment`) AS "nbr"
|
||||
FROM `'._DB_PREFIX_.'product_comment` pc
|
||||
WHERE `id_product` = '.(int)($id_product).($validate == '1' ? ' AND `validate` = 1' : ''));
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -159,26 +159,33 @@ class ProductCommentCriterion extends ObjectModel
|
||||
$table = '_shop';
|
||||
$alias = 'ps';
|
||||
}
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT pcc.`id_product_comment_criterion`, pccl.`name`
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl
|
||||
ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_product` pccp
|
||||
ON (pcc.`id_product_comment_criterion` = pccp.`id_product_comment_criterion` AND pccp.`id_product` = '.(int)$id_product.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_category` pccc
|
||||
ON (pcc.`id_product_comment_criterion` = pccc.`id_product_comment_criterion`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product'.$table.'` '.$alias.'
|
||||
ON ('.$alias.'.id_category_default = pccc.id_category AND '.$alias.'.id_product = '.(int)$id_product.')
|
||||
WHERE pccl.`id_lang` = '.(int)($id_lang).'
|
||||
AND (
|
||||
pccp.id_product IS NOT NULL
|
||||
OR ps.id_product IS NOT NULL
|
||||
OR pcc.id_product_comment_criterion_type = 1
|
||||
)
|
||||
AND pcc.active = 1
|
||||
GROUP BY pcc.id_product_comment_criterion
|
||||
');
|
||||
|
||||
$cache_id = 'ProductCommentCriterion::getByProduct_'.(int)$id_product.'-'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT pcc.`id_product_comment_criterion`, pccl.`name`
|
||||
FROM `'._DB_PREFIX_.'product_comment_criterion` pcc
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl
|
||||
ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_product` pccp
|
||||
ON (pcc.`id_product_comment_criterion` = pccp.`id_product_comment_criterion` AND pccp.`id_product` = '.(int)$id_product.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_category` pccc
|
||||
ON (pcc.`id_product_comment_criterion` = pccc.`id_product_comment_criterion`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product'.$table.'` '.$alias.'
|
||||
ON ('.$alias.'.id_category_default = pccc.id_category AND '.$alias.'.id_product = '.(int)$id_product.')
|
||||
WHERE pccl.`id_lang` = '.(int)($id_lang).'
|
||||
AND (
|
||||
pccp.id_product IS NOT NULL
|
||||
OR ps.id_product IS NOT NULL
|
||||
OR pcc.id_product_comment_criterion_type = 1
|
||||
)
|
||||
AND pcc.active = 1
|
||||
GROUP BY pcc.id_product_comment_criterion
|
||||
');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>productcomments</name>
|
||||
<displayName><![CDATA[Product Comments]]></displayName>
|
||||
<displayName><![CDATA[Commentaires produits]]></displayName>
|
||||
<version><![CDATA[2.4]]></version>
|
||||
<description><![CDATA[Allows users to post reviews.]]></description>
|
||||
<description><![CDATA[Permet aux client de commenter les produits.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
|
||||
@@ -98,6 +98,7 @@ var moderation_active = {$moderation_active};
|
||||
<div id="new_comment_form">
|
||||
<form id="id_new_comment_form" action="#">
|
||||
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
||||
{if isset($product) && $product}
|
||||
<div class="product clearfix">
|
||||
<img src="{$link->getImageLink($product->link_rewrite, $productcomment_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product->name|escape:html:'UTF-8'}" />
|
||||
<div class="product_desc">
|
||||
@@ -105,7 +106,7 @@ var moderation_active = {$moderation_active};
|
||||
{$product->description_short}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
<div class="new_comment_form_content">
|
||||
<h2>{l s='Write your review' mod='productcomments'}</h2>
|
||||
|
||||
|
||||
@@ -43,9 +43,6 @@ class productsCategory extends Module
|
||||
|
||||
$this->displayName = $this->l('Products Category');
|
||||
$this->description = $this->l('Display products of the same category on the product page.');
|
||||
|
||||
if (!$this->isRegisteredInHook('header'))
|
||||
$this->registerHook('header');
|
||||
}
|
||||
|
||||
public function install()
|
||||
|
||||
11
modules/productscategory/upgrade/install-1.5.php
Normal file
11
modules/productscategory/upgrade/install-1.5.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_5($object)
|
||||
{
|
||||
if (!$object->isRegisteredInHook('header'))
|
||||
return $object->registerHook('header');
|
||||
return true;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
padding:15px 20px;
|
||||
background:#ccc
|
||||
}
|
||||
#history #center_column .title_block input {
|
||||
#history #center_column .title_block input {
|
||||
position: relative;
|
||||
top: -8px;
|
||||
float:right;
|
||||
@@ -21,7 +21,6 @@
|
||||
top:2px;
|
||||
left:0
|
||||
}
|
||||
|
||||
#order-list {
|
||||
margin-bottom:20px;
|
||||
width:100%;
|
||||
@@ -36,7 +35,7 @@
|
||||
background:url(../img/bg_table_th.png) repeat-x 0 0 #999
|
||||
}
|
||||
#order-list tr.alternate_item {background-color: #f3f3f3}
|
||||
#order-list td {
|
||||
#order-list td {
|
||||
padding:12px;
|
||||
border-right:1px solid #e9e9e9;
|
||||
border-bottom:1px solid #e9e9e9;
|
||||
@@ -44,12 +43,15 @@
|
||||
font-size:12px;
|
||||
vertical-align:top
|
||||
}
|
||||
#order-list td.history_detail {border-right:none;}
|
||||
#order-list td .price, #order-detail-content tbody .price {
|
||||
white-space: nowrap;
|
||||
}
|
||||
#order-list td.history_detail {border-right:none;}
|
||||
|
||||
#order-list .last_item td {border-bottom:1px solid #999}
|
||||
#order-list .last_item td {border-bottom:1px solid #999}
|
||||
|
||||
.adresses_bloc {margin-bottom:20px}
|
||||
.adresses_bloc .item {margin-right:60px}
|
||||
.adresses_bloc .item {margin-right:60px}
|
||||
|
||||
.detail_step_by_step {width:100%}
|
||||
.detail_step_by_step tr.last_item td {border-bottom:1px solid #999}
|
||||
@@ -66,18 +68,4 @@
|
||||
#sendOrderMessage .textarea textarea {
|
||||
width:100%;
|
||||
border:1px solid #999
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -98,6 +98,7 @@ var moderation_active = {$moderation_active};
|
||||
<div id="new_comment_form">
|
||||
<form id="id_new_comment_form" action="#">
|
||||
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
||||
{if isset($product) && $product}
|
||||
<div class="product clearfix">
|
||||
<img src="{$link->getImageLink($product->link_rewrite, $productcomment_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product->name|escape:html:'UTF-8'}" />
|
||||
<div class="product_desc">
|
||||
@@ -105,7 +106,7 @@ var moderation_active = {$moderation_active};
|
||||
{$product->description_short}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
<div class="new_comment_form_content">
|
||||
<h2>{l s='Write your review' mod='productcomments'}</h2>
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
</td>
|
||||
{/if}
|
||||
<td>
|
||||
<label for="cb_{$product.id_order_detail|intval}">
|
||||
<label class="price" for="cb_{$product.id_order_detail|intval}">
|
||||
{if $group_use_tax}
|
||||
{convertPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
@@ -195,7 +195,7 @@
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="cb_{$product.id_order_detail|intval}">
|
||||
<label class="price" for="cb_{$product.id_order_detail|intval}">
|
||||
{if isset($customizedDatas.$productId.$productAttributeId)}
|
||||
{if $group_use_tax}
|
||||
{convertPriceWithCurrency price=$product.total_customization_wt currency=$currency}
|
||||
@@ -274,7 +274,7 @@
|
||||
</td>
|
||||
{/if}
|
||||
<td>
|
||||
<label for="cb_{$product.id_order_detail|intval}">
|
||||
<label class="price" for="cb_{$product.id_order_detail|intval}">
|
||||
{if $group_use_tax}
|
||||
{convertPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
@@ -283,7 +283,7 @@
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="cb_{$product.id_order_detail|intval}">
|
||||
<label class="price" for="cb_{$product.id_order_detail|intval}">
|
||||
{if $group_use_tax}
|
||||
{convertPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
{elseif $field_name eq "lastname"}
|
||||
<p class="required text">
|
||||
<label for="lastname_invoice">{l s='Last name'} <sup>*</sup></label>
|
||||
<input type="text" class="text" id="lastname_invoice" name="lastname_invoice" value="{if isset($guestInformations) && $guestInformations.firstname_invoice}{$guestInformations.firstname_invoice}{/if}" />
|
||||
<input type="text" class="text" id="lastname_invoice" name="lastname_invoice" value="{if isset($guestInformations) && $guestInformations.lastname_invoice}{$guestInformations.lastname_invoice}{/if}" />
|
||||
</p>
|
||||
{elseif $field_name eq "address1"}
|
||||
<p class="required text">
|
||||
|
||||
@@ -466,13 +466,19 @@ abstract class Controller extends ControllerCore
|
||||
echo '<br /><b>Useless GROUP BY need to be removed</b>';
|
||||
}
|
||||
}
|
||||
echo '</div>
|
||||
<div class="rte" style="text-align:left;padding:8px">
|
||||
<h3><a name="doubles">Doubles (IDs replaced by "XX") (total = '.count(Db::getInstance()->uniqQueries).')</a></h3>';
|
||||
$queries = Db::getInstance()->uniqQueries;
|
||||
arsort($queries);
|
||||
$count = count(Db::getInstance()->uniqQueries);
|
||||
foreach ($queries as $q => &$nb)
|
||||
if ($nb == 1)
|
||||
$count--;
|
||||
if ($count)
|
||||
echo '</div>
|
||||
<div class="rte" style="text-align:left;padding:8px">
|
||||
<h3><a name="doubles">Doubles (IDs replaced by "XX") (total = '.$count.')</a></h3>';
|
||||
foreach ($queries as $q => $nb)
|
||||
echo $hr.'<b '.$this->getQueryColor($nb).'>'.$nb.'</b> '.$q;
|
||||
if($nb > 1)
|
||||
echo $hr.'<b '.$this->getQueryColor($nb).'>'.$nb.'</b> '.$q;
|
||||
echo '</div>
|
||||
<div class="rte" style="text-align:left;padding:8px">
|
||||
<h3><a name="tables">Tables stress</a></h3>';
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user