Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
commit
6ea3783013
65 files changed
+453
-285
No files matched your search
@@ -30,6 +30,7 @@ select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disab
|
|||||||
|
|
||||||
/*BUTTON*/
|
/*BUTTON*/
|
||||||
.button{
|
.button{
|
||||||
|
cursor: pointer;
|
||||||
background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top;
|
background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top;
|
||||||
background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 transparent;
|
background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 transparent;
|
||||||
background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#E3E3E3)) repeat scroll 0 0 transparent;
|
background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#E3E3E3)) repeat scroll 0 0 transparent;
|
||||||
@@ -673,4 +674,4 @@ ul.listForm li {padding-bottom:3px;}
|
|||||||
|
|
||||||
/************** SCENE *****************/
|
/************** SCENE *****************/
|
||||||
|
|
||||||
#large_scene_image{clear:both;border:1px solid transparent;}
|
#large_scene_image{clear:both;border:1px solid transparent;}
|
||||||
@@ -110,14 +110,14 @@ $(document).ready(function() {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="partner_preactivation">
|
<div id="partner_preactivation">
|
||||||
<p class="center"><img src="../img/loader.gif" alt="" /></p>
|
<p class="center"><img src="../img/loader.gif" alt="" /> {l s='Loading...'}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="separation"></div>
|
<div class="separation"></div>
|
||||||
|
|
||||||
|
|
||||||
{$tips_optimization}
|
{$tips_optimization}
|
||||||
<div id="discover_prestashop"><p class="center"><img src="../img/loader.gif" alt="" />{l s='Loading...'}</p></div>
|
<div id="discover_prestashop"><p class="center"><img src="../img/loader.gif" alt="" /> {l s='Loading...'}</p></div>
|
||||||
|
|
||||||
{hook h="displayAdminHomeInfos"}
|
{hook h="displayAdminHomeInfos"}
|
||||||
{hook h="displayBackOfficeHome"} {*old name of the hook*}
|
{hook h="displayBackOfficeHome"} {*old name of the hook*}
|
||||||
@@ -212,7 +212,7 @@ $(document).ready(function() {
|
|||||||
{
|
{
|
||||||
// don't show/hide screencast if it's deactivated
|
// don't show/hide screencast if it's deactivated
|
||||||
{if $employee->bo_show_screencast}
|
{if $employee->bo_show_screencast}
|
||||||
$('#adminpresentation').fadeOut('slow');
|
$('#adminpresentation').fadeOut('slow');
|
||||||
{/if}
|
{/if}
|
||||||
$('#partner_preactivation').fadeOut('slow');
|
$('#partner_preactivation').fadeOut('slow');
|
||||||
$('#discover_prestashop').fadeOut('slow');
|
$('#discover_prestashop').fadeOut('slow');
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
*}
|
*}
|
||||||
|
|
||||||
<div class="width4">
|
<div class="width4">
|
||||||
{$localization_form}
|
{if isset($localization_form)}{$localization_form}{/if}
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="width4">
|
<div class="width4">
|
||||||
{$localization_options}
|
{if isset($localization_options)}{$localization_options}{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -30,9 +30,9 @@
|
|||||||
function ajaxStoreStates(id_state_selected)
|
function ajaxStoreStates(id_state_selected)
|
||||||
{
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "ajax.php",
|
url: "index.php",
|
||||||
cache: false,
|
cache: false,
|
||||||
data: "ajaxStates=1&id_country="+$('#PS_SHOP_COUNTRY_ID').val() + "&id_state=" + $('#PS_SHOP_STATE_ID').val(),
|
data: "ajax=1&tab=AdminStates&token={getAdminToken tab='AdminStates'}&action=states&id_country="+$('#PS_SHOP_COUNTRY_ID').val() + "&id_state=" + $('#PS_SHOP_STATE_ID').val(),
|
||||||
success: function(html)
|
success: function(html)
|
||||||
{
|
{
|
||||||
if (html == 'false')
|
if (html == 'false')
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: "index.php",
|
url: "index.php",
|
||||||
cache: false,
|
cache: false,
|
||||||
data: "ajax=1&tab=AdminTaxRulesGroup&token={getAdminToken tab='AdminStates'}&action=states&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}",
|
data: "ajax=1&tab=AdminStates&token={getAdminToken tab='AdminStates'}&action=states&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}",
|
||||||
success: function(html){
|
success: function(html){
|
||||||
if (html == "false")
|
if (html == "false")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class Autoload
|
|||||||
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
|
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
|
||||||
if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE)
|
if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE)
|
||||||
{
|
{
|
||||||
rename($filename_tmp, $filename);
|
@rename($filename_tmp, $filename);
|
||||||
@chmod($filename, 0664);
|
@chmod($filename, 0664);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ class CartRuleCore extends ObjectModel
|
|||||||
// Check if the products chosen by the customer are usable with the cart rule
|
// Check if the products chosen by the customer are usable with the cart rule
|
||||||
if ($this->product_restriction)
|
if ($this->product_restriction)
|
||||||
{
|
{
|
||||||
$r = $this->checkProductRestrictions($context, false, $display_error);
|
$r = $this->checkProductRestrictions($context, false, $display_error, $alreadyInCart);
|
||||||
if ($r !== false && $display_error)
|
if ($r !== false && $display_error)
|
||||||
return $r;
|
return $r;
|
||||||
elseif (!$r && !$display_error)
|
elseif (!$r && !$display_error)
|
||||||
@@ -523,6 +523,7 @@ class CartRuleCore extends ObjectModel
|
|||||||
return (!$display_error) ? false : Tools::displayError('This voucher is already in your cart');
|
return (!$display_error) ? false : Tools::displayError('This voucher is already in your cart');
|
||||||
if ($otherCartRule['gift_product'])
|
if ($otherCartRule['gift_product'])
|
||||||
--$nb_products;
|
--$nb_products;
|
||||||
|
|
||||||
if ($this->cart_rule_restriction && $otherCartRule['cart_rule_restriction'] && $otherCartRule['id_cart_rule'] != $this->id)
|
if ($this->cart_rule_restriction && $otherCartRule['cart_rule_restriction'] && $otherCartRule['id_cart_rule'] != $this->id)
|
||||||
{
|
{
|
||||||
$combinable = Db::getInstance()->getValue('
|
$combinable = Db::getInstance()->getValue('
|
||||||
@@ -550,7 +551,7 @@ class CartRuleCore extends ObjectModel
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkProductRestrictions(Context $context, $return_products = false, $display_error = true)
|
protected function checkProductRestrictions(Context $context, $return_products = false, $display_error = true, $alreadyInCart = false)
|
||||||
{
|
{
|
||||||
$selectedProducts = array();
|
$selectedProducts = array();
|
||||||
|
|
||||||
@@ -585,6 +586,8 @@ class CartRuleCore extends ObjectModel
|
|||||||
if (in_array($cartAttribute['id_attribute'], $productRule['values']))
|
if (in_array($cartAttribute['id_attribute'], $productRule['values']))
|
||||||
{
|
{
|
||||||
$countMatchingProducts += $cartAttribute['quantity'];
|
$countMatchingProducts += $cartAttribute['quantity'];
|
||||||
|
if ($alreadyInCart && $this->gift_product == $cartProduct['id_product']&& $this->gift_product_attribute == $cartProduct['id_product_attribute'])
|
||||||
|
--$countMatchingProducts;
|
||||||
$matchingProductsList[] = $cartAttribute['id_product'].'-'.$cartAttribute['id_product_attribute'];
|
$matchingProductsList[] = $cartAttribute['id_product'].'-'.$cartAttribute['id_product_attribute'];
|
||||||
}
|
}
|
||||||
if ($countMatchingProducts < $productRuleGroup['quantity'])
|
if ($countMatchingProducts < $productRuleGroup['quantity'])
|
||||||
@@ -603,6 +606,8 @@ class CartRuleCore extends ObjectModel
|
|||||||
if (in_array($cartProduct['id_product'], $productRule['values']))
|
if (in_array($cartProduct['id_product'], $productRule['values']))
|
||||||
{
|
{
|
||||||
$countMatchingProducts += $cartProduct['quantity'];
|
$countMatchingProducts += $cartProduct['quantity'];
|
||||||
|
if ($alreadyInCart && $this->gift_product == $cartProduct['id_product'])
|
||||||
|
--$countMatchingProducts;
|
||||||
$matchingProductsList[] = $cartProduct['id_product'].'-0';
|
$matchingProductsList[] = $cartProduct['id_product'].'-0';
|
||||||
}
|
}
|
||||||
if ($countMatchingProducts < $productRuleGroup['quantity'])
|
if ($countMatchingProducts < $productRuleGroup['quantity'])
|
||||||
|
|||||||
+14
-8
@@ -120,16 +120,22 @@ class ImageCore extends ObjectModel
|
|||||||
*
|
*
|
||||||
* @param integer $id_lang Language ID
|
* @param integer $id_lang Language ID
|
||||||
* @param integer $id_product Product ID
|
* @param integer $id_product Product ID
|
||||||
|
* @param integer $id_product_attribute Product Attribute ID
|
||||||
* @return array Images
|
* @return array Images
|
||||||
*/
|
*/
|
||||||
public static function getImages($id_lang, $id_product)
|
public static function getImages($id_lang, $id_product, $id_product_attribute = NULL)
|
||||||
{
|
{
|
||||||
return Db::getInstance()->executeS('
|
$attribute_filter = ($id_product_attribute ? ' AND ai.`id_product_attribute` = '.(int)$id_product_attribute : '');
|
||||||
SELECT *
|
$sql = 'SELECT *
|
||||||
FROM `'._DB_PREFIX_.'image` i
|
FROM `'._DB_PREFIX_.'image` i
|
||||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)
|
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)';
|
||||||
WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang.'
|
|
||||||
ORDER BY i.`position` ASC');
|
if ($id_product_attribute)
|
||||||
|
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` ai ON (i.`id_image` = ai.`id_image`)';
|
||||||
|
|
||||||
|
$sql .= ' WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang . $attribute_filter.'
|
||||||
|
ORDER BY i.`position` ASC';
|
||||||
|
return Db::getInstance()->executeS($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -644,7 +650,7 @@ class ImageCore extends ObjectModel
|
|||||||
*/
|
*/
|
||||||
public static function testFileSystem()
|
public static function testFileSystem()
|
||||||
{
|
{
|
||||||
$safe_mode = ini_get('safe_mode');
|
$safe_mode = Tools::getSafeModeStatus();
|
||||||
if ($safe_mode)
|
if ($safe_mode)
|
||||||
return false;
|
return false;
|
||||||
$folder1 = _PS_PROD_IMG_DIR_.'testfilesystem/';
|
$folder1 = _PS_PROD_IMG_DIR_.'testfilesystem/';
|
||||||
|
|||||||
+19
-5
@@ -111,18 +111,22 @@ class LanguageCore extends ObjectModel
|
|||||||
$iso_code = $newIso ? $newIso : $this->iso_code;
|
$iso_code = $newIso ? $newIso : $this->iso_code;
|
||||||
|
|
||||||
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
|
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
|
||||||
mkdir(_PS_TRANSLATIONS_DIR_.$iso_code);
|
{
|
||||||
|
if (@mkdir(_PS_TRANSLATIONS_DIR_.$iso_code))
|
||||||
|
@chmod(_PS_TRANSLATIONS_DIR_.$iso_code, 0777);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->translationsFilesAndVars as $file => $var)
|
foreach ($this->translationsFilesAndVars as $file => $var)
|
||||||
{
|
{
|
||||||
$path_file = _PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php';
|
$path_file = _PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php';
|
||||||
if (!file_exists($path_file))
|
if (!file_exists($path_file))
|
||||||
if ($file != 'tabs')
|
if ($file != 'tabs')
|
||||||
file_put_contents($path_file, '<?php
|
@file_put_contents($path_file, '<?php
|
||||||
global $'.$var.';
|
global $'.$var.';
|
||||||
$'.$var.' = array();
|
$'.$var.' = array();
|
||||||
?>');
|
?>');
|
||||||
else
|
else
|
||||||
file_put_contents($path_file, '<?php
|
@file_put_contents($path_file, '<?php
|
||||||
$'.$var.' = array();
|
$'.$var.' = array();
|
||||||
return $'.$var.';
|
return $'.$var.';
|
||||||
?>');
|
?>');
|
||||||
@@ -460,7 +464,8 @@ class LanguageCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
rmdir($dir);
|
if (is_writable($dir))
|
||||||
|
rmdir($dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete()
|
public function delete()
|
||||||
@@ -783,13 +788,22 @@ class LanguageCore extends ObjectModel
|
|||||||
$lang_pack_ok = false;
|
$lang_pack_ok = false;
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip';
|
$file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip';
|
||||||
|
|
||||||
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower($iso)))
|
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower($iso)))
|
||||||
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
|
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
|
||||||
elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link))
|
elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link))
|
||||||
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
|
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
|
||||||
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip')))
|
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip')))
|
||||||
if (!@file_put_contents($file, $content))
|
if (!@file_put_contents($file, $content))
|
||||||
$errors[] = Tools::displayError('Server does not have permissions for writing.');
|
{
|
||||||
|
if (is_writable(dirname($file)))
|
||||||
|
{
|
||||||
|
@unlink($file);
|
||||||
|
@file_put_contents($file, $content);
|
||||||
|
}
|
||||||
|
elseif (!is_writable($file))
|
||||||
|
$errors[] = Tools::displayError('Server does not have permissions for writing.').' ('.$file.')';
|
||||||
|
}
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$gz = new Archive_Tar($file, true);
|
$gz = new Archive_Tar($file, true);
|
||||||
|
|||||||
@@ -149,6 +149,11 @@ class LoggerCore extends ObjectModel
|
|||||||
|
|
||||||
return $this->hash;
|
return $this->hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function eraseAllLogs()
|
||||||
|
{
|
||||||
|
return Db::getInstance()->execute('TRUNCATE TABLE '._DB_PREFIX_.'log');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if this log message already exists in database.
|
* check if this log message already exists in database.
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class ManufacturerCore extends ObjectModel
|
|||||||
|
|
||||||
// Lang fields
|
// Lang fields
|
||||||
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||||
'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 254),
|
'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||||
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
||||||
|
|||||||
+1
-1
@@ -2914,7 +2914,7 @@ class ProductCore extends ObjectModel
|
|||||||
* @param Shop $shop
|
* @param Shop $shop
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function sqlStock($product_alias, $product_attribute = 0, $inner_join = false, Shop $shop = null)
|
public static function sqlStock($product_alias, $product_attribute = null, $inner_join = false, Shop $shop = null)
|
||||||
{
|
{
|
||||||
$id_shop = ($shop !== null ? (int)$shop->id : null);
|
$id_shop = ($shop !== null ? (int)$shop->id : null);
|
||||||
$sql = (($inner_join) ? ' INNER ' : ' LEFT ').'
|
$sql = (($inner_join) ? ' INNER ' : ' LEFT ').'
|
||||||
|
|||||||
+27
-30
@@ -140,36 +140,33 @@ class SearchCore
|
|||||||
$string = implode(' ', $processed_words);
|
$string = implode(' ', $processed_words);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($indexation)
|
// If the language is constituted with symbol and there is no "words", then split every chars
|
||||||
|
if (in_array($iso_code, array('zh', 'tw', 'ja')) && function_exists('mb_strlen'))
|
||||||
{
|
{
|
||||||
// If the language is constituted with symbol and there is no "words", then split every chars
|
// Cut symbols from letters
|
||||||
if (in_array($iso_code, array('zh', 'tw', 'ja')) && function_exists('mb_strlen'))
|
$symbols = '';
|
||||||
{
|
$letters = '';
|
||||||
// Cut symbols from letters
|
foreach (explode(' ', $string) as $mb_word)
|
||||||
$symbols = '';
|
if (strlen(Tools::replaceAccentedChars($mb_word)) == mb_strlen(Tools::replaceAccentedChars($mb_word)))
|
||||||
$letters = '';
|
$letters .= $mb_word.' ';
|
||||||
foreach (explode(' ', $string) as $mb_word)
|
else
|
||||||
if (strlen(Tools::replaceAccentedChars($mb_word)) == mb_strlen(Tools::replaceAccentedChars($mb_word)))
|
$symbols .= $mb_word.' ';
|
||||||
$letters .= $mb_word.' ';
|
|
||||||
else
|
if (preg_match_all('/./u', $symbols, $matches))
|
||||||
$symbols .= $mb_word.' ';
|
$symbols = implode(' ', $matches[0]);
|
||||||
|
|
||||||
if (preg_match_all('/./u', $symbols, $matches))
|
|
||||||
$symbols = implode(' ', $matches[0]);
|
|
||||||
|
|
||||||
$string = $letters.$symbols;
|
$string = $letters.$symbols;
|
||||||
}
|
}
|
||||||
else
|
elseif ($indexation)
|
||||||
|
{
|
||||||
|
$minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN');
|
||||||
|
if ($minWordLen > 1)
|
||||||
{
|
{
|
||||||
$minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN');
|
$minWordLen -= 1;
|
||||||
if ($minWordLen > 1)
|
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}(?=\s)/Su', ' ', $string);
|
||||||
{
|
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}(?=\s)/Su', '', $string);
|
||||||
$minWordLen -= 1;
|
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
||||||
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}(?=\s)/Su', ' ', $string);
|
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
||||||
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}(?=\s)/Su', '', $string);
|
|
||||||
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
|
||||||
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,13 +371,13 @@ class SearchCore
|
|||||||
|
|
||||||
$attributes = '';
|
$attributes = '';
|
||||||
$attributesArray = $db->executeS('
|
$attributesArray = $db->executeS('
|
||||||
SELECT al.name, pa.ean13, pa.reference, pa.upc FROM '._DB_PREFIX_.'product_attribute pa
|
SELECT al.name FROM '._DB_PREFIX_.'product_attribute pa
|
||||||
INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute
|
INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute
|
||||||
INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.')
|
INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.')
|
||||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||||
WHERE pa.id_product = '.(int)$id_product);
|
WHERE pa.id_product = '.(int)$id_product);
|
||||||
foreach ($attributesArray as $attribute)
|
foreach ($attributesArray as $attribute)
|
||||||
$attributes .= $attribute['name'].' '.$attribute['ean13'].' '.$attribute['reference'].' '.$attribute['upc'].' ';
|
$attributes .= $attribute['name'].' ';
|
||||||
return $attributes;
|
return $attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,4 +699,4 @@ class SearchCore
|
|||||||
|
|
||||||
return Product::getProductsProperties((int)$id_lang, $result);
|
return Product::getProductsProperties((int)$id_lang, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ class SupplierCore extends ObjectModel
|
|||||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||||
|
|
||||||
// Lang fields
|
// Lang fields
|
||||||
'description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||||
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
|
|||||||
+43
-66
@@ -2481,89 +2481,66 @@ exit;
|
|||||||
return preg_replace('/\\\[px]\{[a-z]\}{1,2}|(\/[a-z]*)u([a-z]*)$/i', "$1$2", $pattern);
|
return preg_replace('/\\\[px]\{[a-z]\}{1,2}|(\/[a-z]*)u([a-z]*)$/i', "$1$2", $pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static $is_addons_up = true;
|
||||||
public static function addonsRequest($request, $params = array())
|
public static function addonsRequest($request, $params = array())
|
||||||
{
|
{
|
||||||
$addons_url = 'api.addons.prestashop.com';
|
if (!self::$is_addons_up)
|
||||||
$postData = '';
|
return false;
|
||||||
$postDataArray = array(
|
|
||||||
|
$postData = http_build_query(array(
|
||||||
'version' => isset($params['version']) ? $params['version'] : _PS_VERSION_,
|
'version' => isset($params['version']) ? $params['version'] : _PS_VERSION_,
|
||||||
'iso_lang' => Tools::strtolower(isset($params['iso_lang']) ? $params['iso_lang'] : Context::getContext()->language->iso_code),
|
'iso_lang' => Tools::strtolower(isset($params['iso_lang']) ? $params['iso_lang'] : Context::getContext()->language->iso_code),
|
||||||
'iso_code' => Tools::strtolower(isset($params['iso_country']) ? $params['iso_country'] : Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
|
'iso_code' => Tools::strtolower(isset($params['iso_country']) ? $params['iso_country'] : Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
|
||||||
'shop_url' => urlencode(isset($params['shop_url']) ? $params['shop_url'] : Tools::getShopDomain()),
|
'shop_url' => isset($params['shop_url']) ? $params['shop_url'] : Tools::getShopDomain(),
|
||||||
'mail' => urlencode(isset($params['email']) ? $params['email'] : Configuration::get('email'))
|
'mail' => isset($params['email']) ? $params['email'] : Configuration::get('email')
|
||||||
);
|
));
|
||||||
foreach ($postDataArray as $postDataKey => $postDataValue)
|
|
||||||
$postData .= '&'.$postDataKey.'='.$postDataValue;
|
|
||||||
$postData = ltrim($postData, '&');
|
|
||||||
|
|
||||||
// Config for each request
|
$protocols = array('https');
|
||||||
if ($request == 'native')
|
switch ($request)
|
||||||
{
|
{
|
||||||
// Define protocol accepted and post data values for this request
|
case 'native':
|
||||||
$protocolsList = array('https://' => 443, 'http://' => 80);
|
$protocols[] = 'http';
|
||||||
$postData .= '&method=listing&action=native';
|
$postData .= '&method=listing&action=native';
|
||||||
}
|
break;
|
||||||
if ($request == 'must-have')
|
case 'must-have':
|
||||||
{
|
$protocols[] = 'http';
|
||||||
// Define protocol accepted and post data values for this request
|
$postData .= '&method=listing&action=must-have';
|
||||||
$protocolsList = array('https://' => 443, 'http://' => 80);
|
break;
|
||||||
$postData .= '&method=listing&action=must-have';
|
case 'customer':
|
||||||
}
|
$postData .= '&method=listing&action=customer&username='.urlencode(trim(Context::getContext()->cookie->username_addons)).'&password='.urlencode(trim(Context::getContext()->cookie->password_addons));
|
||||||
if ($request == 'customer')
|
break;
|
||||||
{
|
case 'check_customer':
|
||||||
// Define protocol accepted and post data values for this request
|
$postData .= '&method=check_customer&username='.urlencode($params['username_addons']).'&password='.urlencode($params['password_addons']);
|
||||||
$protocolsList = array('https://' => 443);
|
break;
|
||||||
$postData .= '&method=listing&action=customer&username='.urlencode(trim(Context::getContext()->cookie->username_addons)).'&password='.urlencode(trim(Context::getContext()->cookie->password_addons));
|
case 'module':
|
||||||
}
|
|
||||||
if ($request == 'check_customer')
|
|
||||||
{
|
|
||||||
// Define protocol accepted and post data values for this request
|
|
||||||
$protocolsList = array('https://' => 443);
|
|
||||||
$postData .= '&method=check_customer&username='.urlencode($params['username_addons']).'&password='.urlencode($params['password_addons']);
|
|
||||||
}
|
|
||||||
if ($request == 'module')
|
|
||||||
{
|
|
||||||
// Define protocol accepted and post data values for this request
|
|
||||||
if (isset($params['username_addons']) && isset($params['password_addons']))
|
|
||||||
{
|
|
||||||
$protocolsList = array('https://' => 443);
|
|
||||||
$postData .= '&method=module&id_module='.urlencode($params['id_module']).'&username='.urlencode($params['username_addons']).'&password='.urlencode($params['password_addons']);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$protocolsList = array('https://' => 443, 'http://' => 80);
|
|
||||||
$postData .= '&method=module&id_module='.urlencode($params['id_module']);
|
$postData .= '&method=module&id_module='.urlencode($params['id_module']);
|
||||||
}
|
if (isset($params['username_addons']) && isset($params['password_addons']))
|
||||||
}
|
$postData .= '&username='.urlencode($params['username_addons']).'&password='.urlencode($params['password_addons']);
|
||||||
|
else
|
||||||
if ($request == 'install-modules')
|
$protocols[] = 'http';
|
||||||
{
|
|
||||||
// Define protocol accepted and post data values for this request
|
break;
|
||||||
$protocolsList = array('https://' => 443, 'http://' => 80);
|
case 'install-modules':
|
||||||
$postData .= '&method=listing&action=install-modules';
|
$protocols[] = 'http';
|
||||||
|
$postData .= '&method=listing&action=install-modules';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the request
|
$context = stream_context_create(array(
|
||||||
$opts = array(
|
'http' => array(
|
||||||
'http'=>array(
|
|
||||||
'method'=> 'POST',
|
'method'=> 'POST',
|
||||||
'content' => $postData,
|
'content' => $postData,
|
||||||
'header' => 'Content-type: application/x-www-form-urlencoded',
|
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||||
'timeout' => 5,
|
'timeout' => 5,
|
||||||
)
|
)
|
||||||
);
|
));
|
||||||
$context = stream_context_create($opts);
|
foreach ($protocols as $protocol)
|
||||||
foreach ($protocolsList as $protocol => $port)
|
if ($content = Tools::file_get_contents($protocol.'://api.addons.prestashop.com', false, $context))
|
||||||
{
|
|
||||||
$content = Tools::file_get_contents($protocol.$addons_url, false, $context);
|
|
||||||
|
|
||||||
// If content returned, we cache it
|
|
||||||
if ($content)
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
|
||||||
|
|
||||||
// No content, return false
|
self::$is_addons_up = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+5
-2
@@ -34,9 +34,12 @@ class CacheApcCore extends Cache
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->keys = array();
|
$this->keys = array();
|
||||||
$cache_info = apc_cache_info('user');
|
$cache_info = apc_cache_info((extension_loaded('apcu') === true )? '' : 'user' );
|
||||||
foreach ($cache_info['cache_list'] as $entry)
|
foreach ($cache_info['cache_list'] as $entry)
|
||||||
$this->keys[$entry['info']] = $entry['ttl'];
|
if ( extension_loaded('apcu') === true )
|
||||||
|
$this->keys[$entry['key']] = $entry['ttl'];
|
||||||
|
else
|
||||||
|
$this->keys[$entry['info']] = $entry['ttl'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Vendored
+1
-1
@@ -49,7 +49,7 @@ class CacheMemcacheCore extends Cache
|
|||||||
|
|
||||||
if(is_array($servers) && count($servers) > 0)
|
if(is_array($servers) && count($servers) > 0)
|
||||||
{
|
{
|
||||||
$this->keys = $this->memcache->get(_COOKIE_IV_);
|
$this->keys = @$this->memcache->get(_COOKIE_IV_);
|
||||||
if (!is_array($this->keys))
|
if (!is_array($this->keys))
|
||||||
$this->keys = array();
|
$this->keys = array();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -726,6 +726,8 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
public function processAdd()
|
public function processAdd()
|
||||||
{
|
{
|
||||||
|
if (!isset($this->className) || empty($this->className))
|
||||||
|
return false;
|
||||||
/* Checking fields validity */
|
/* Checking fields validity */
|
||||||
$this->validateRules();
|
$this->validateRules();
|
||||||
if (count($this->errors) <= 0)
|
if (count($this->errors) <= 0)
|
||||||
@@ -1142,6 +1144,8 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
protected function loadObject($opt = false)
|
protected function loadObject($opt = false)
|
||||||
{
|
{
|
||||||
|
if (!isset($this->className) || empty($this->className))
|
||||||
|
return true;
|
||||||
$id = (int)Tools::getValue($this->identifier);
|
$id = (int)Tools::getValue($this->identifier);
|
||||||
if ($id && Validate::isUnsignedId($id))
|
if ($id && Validate::isUnsignedId($id))
|
||||||
{
|
{
|
||||||
@@ -1535,21 +1539,23 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
protected function addToolBarModulesListButton()
|
protected function addToolBarModulesListButton()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400))
|
if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400))
|
||||||
file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));
|
file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));
|
||||||
|
|
||||||
$country_module_list_xml = simplexml_load_file(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
|
$country_module_list = file_get_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
|
||||||
$country_module_list = array();
|
if (!empty($country_module_list) && $country_module_list_xml = simplexml_load_string($country_module_list))
|
||||||
|
{
|
||||||
|
$country_module_list_array = array();
|
||||||
foreach ($country_module_list_xml->module as $k => $m)
|
foreach ($country_module_list_xml->module as $k => $m)
|
||||||
$country_module_list[] = (string)$m->name;
|
$country_module_list_array[] = (string)$m->name;
|
||||||
$this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list);
|
$this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list_array);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
||||||
$this->toolbar_btn['modules-list'] = array(
|
$this->toolbar_btn['modules-list'] = array(
|
||||||
'href' => '#',
|
'href' => '#',
|
||||||
'desc' => $this->l('Modules List')
|
'desc' => $this->l('Modules List')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2400,7 +2406,7 @@ class AdminControllerCore extends Controller
|
|||||||
public function getFieldValue($obj, $key, $id_lang = null)
|
public function getFieldValue($obj, $key, $id_lang = null)
|
||||||
{
|
{
|
||||||
if ($id_lang)
|
if ($id_lang)
|
||||||
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
$default_value = (isset($obj->id) && $obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
||||||
else
|
else
|
||||||
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
|
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
|
||||||
|
|
||||||
@@ -2939,21 +2945,17 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
public function isFresh($file, $timeout = 604800000)
|
public function isFresh($file, $timeout = 604800000)
|
||||||
{
|
{
|
||||||
if (file_exists(_PS_ROOT_DIR_.$file))
|
if (file_exists(_PS_ROOT_DIR_.$file) && filesize(_PS_ROOT_DIR_.$file) > 0)
|
||||||
{
|
|
||||||
if (filesize(_PS_ROOT_DIR_.$file) < 1)
|
|
||||||
return false;
|
|
||||||
return ((time() - filemtime(_PS_ROOT_DIR_.$file)) < $timeout);
|
return ((time() - filemtime(_PS_ROOT_DIR_.$file)) < $timeout);
|
||||||
}
|
return false;
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static $is_prestashop_up = true;
|
||||||
public function refresh($file_to_refresh, $external_file)
|
public function refresh($file_to_refresh, $external_file)
|
||||||
{
|
{
|
||||||
$content = Tools::file_get_contents($external_file);
|
if (self::$is_prestashop_up && $content = Tools::file_get_contents($external_file))
|
||||||
if ($content)
|
|
||||||
return (bool)file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content);
|
return (bool)file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content);
|
||||||
|
self::$is_prestashop_up = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -512,7 +512,7 @@ class FrontControllerCore extends Controller
|
|||||||
if (Configuration::get('PS_CSS_THEME_CACHE'))
|
if (Configuration::get('PS_CSS_THEME_CACHE'))
|
||||||
$this->css_files = Media::cccCSS($this->css_files);
|
$this->css_files = Media::cccCSS($this->css_files);
|
||||||
//JS compressor management
|
//JS compressor management
|
||||||
if (Configuration::get('PS_JS_THEME_CACHE'))
|
if (Configuration::get('PS_JS_THEME_CACHE') && !$this->context->getMobileDevice())
|
||||||
$this->js_files = Media::cccJs($this->js_files);
|
$this->js_files = Media::cccJs($this->js_files);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ abstract class ModuleCore
|
|||||||
$this->_errors[] = $upgrade_detail['number_upgrade_left'].' '.$this->l('upgrade left');
|
$this->_errors[] = $upgrade_detail['number_upgrade_left'].' '.$this->l('upgrade left');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($upgrade_detail['duplicate'])
|
if (isset($upgrade_detail['duplicate']) && $upgrade_detail['duplicate'])
|
||||||
$this->_errors[] = sprintf(Tools::displayError('Module %s cannot be upgraded this time: please refresh this page to update it.'), $this->name);
|
$this->_errors[] = sprintf(Tools::displayError('Module %s cannot be upgraded this time: please refresh this page to update it.'), $this->name);
|
||||||
else
|
else
|
||||||
$this->_errors[] = $this->l('To prevent any problem, this module has been turned off');
|
$this->_errors[] = $this->l('To prevent any problem, this module has been turned off');
|
||||||
@@ -1726,7 +1726,15 @@ abstract class ModuleCore
|
|||||||
<need_instance>'.(int)$this->need_instance.'</need_instance>'.(isset($this->limited_countries) ? "\n\t".'<limited_countries>'.(count($this->limited_countries) == 1 ? $this->limited_countries[0] : '').'</limited_countries>' : '').'
|
<need_instance>'.(int)$this->need_instance.'</need_instance>'.(isset($this->limited_countries) ? "\n\t".'<limited_countries>'.(count($this->limited_countries) == 1 ? $this->limited_countries[0] : '').'</limited_countries>' : '').'
|
||||||
</module>';
|
</module>';
|
||||||
if (is_writable(_PS_MODULE_DIR_.$this->name.'/'))
|
if (is_writable(_PS_MODULE_DIR_.$this->name.'/'))
|
||||||
file_put_contents(_PS_MODULE_DIR_.$this->name.'/config.xml', $xml);
|
{
|
||||||
|
$file = _PS_MODULE_DIR_.$this->name.'/config.xml';
|
||||||
|
if (!@file_put_contents($file, $xml))
|
||||||
|
if (!is_writable($file))
|
||||||
|
{
|
||||||
|
@unlink($file);
|
||||||
|
@file_put_contents($file, $xml);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -712,11 +712,10 @@ class OrderCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getCartRules()
|
public function getCartRules()
|
||||||
{
|
{
|
||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM `'._DB_PREFIX_.'order_cart_rule` ocr
|
FROM `'._DB_PREFIX_.'order_cart_rule` ocr
|
||||||
LEFT JOIN `'._DB_PREFIX_.'cart_rule` cr ON cr.`id_cart_rule` = ocr.`id_cart_rule`
|
|
||||||
WHERE ocr.`id_order` = '.(int)$this->id);
|
WHERE ocr.`id_order` = '.(int)$this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ class OrderCartRuleCore extends ObjectModel
|
|||||||
|
|
||||||
/** @var float value (tax excl.) of voucher */
|
/** @var float value (tax excl.) of voucher */
|
||||||
public $value_tax_excl;
|
public $value_tax_excl;
|
||||||
|
|
||||||
|
/** @var boolean value : voucher gives free shipping or not */
|
||||||
|
public $free_shipping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ObjectModel::$definition
|
* @see ObjectModel::$definition
|
||||||
@@ -59,7 +62,8 @@ class OrderCartRuleCore extends ObjectModel
|
|||||||
'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true),
|
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true),
|
||||||
'value' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
'value' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||||
'value_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true)
|
'value_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||||
|
'free_shipping' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -129,19 +129,6 @@ class OrderSlipCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$products[$key] = $product;
|
$products[$key] = $product;
|
||||||
$products[$key]['product_quantity'] = $slip_quantity[$product['id_order_detail']];
|
$products[$key]['product_quantity'] = $slip_quantity[$product['id_order_detail']];
|
||||||
if (count($cart_rules))
|
|
||||||
{
|
|
||||||
$order->setProductPrices($product);
|
|
||||||
$realProductPrice = $products[$key]['product_price'];
|
|
||||||
// Todo : must be updated to use the cart rules
|
|
||||||
foreach ($cart_rules as $cart_rule)
|
|
||||||
{
|
|
||||||
if ($cart_rule['reduction_percent'])
|
|
||||||
$products[$key]['product_price'] -= $realProductPrice * ($cart_rule['reduction_percent'] / 100);
|
|
||||||
elseif ($cart_rule['reduction_amount'])
|
|
||||||
$products[$key]['product_price'] -= (($cart_rule['reduction_amount'] * ($product['product_price_wt'] / $order->total_products_wt)) / (1.00 + ($product['tax_rate'] / 100)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $order->getProducts($products);
|
return $order->getProducts($products);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1260,40 +1260,40 @@ class WebserviceRequestCore
|
|||||||
if (!isset($this->urlFragments['display']))
|
if (!isset($this->urlFragments['display']))
|
||||||
$this->fieldsToDisplay = 'full';
|
$this->fieldsToDisplay = 'full';
|
||||||
|
|
||||||
// Check if Object is accessible for this/those id_shop
|
|
||||||
$assoc = Shop::getAssoTable($this->resourceConfiguration['retrieveData']['table']);
|
|
||||||
if ($assoc !== false)
|
|
||||||
{
|
|
||||||
$check_shop_group = false;
|
|
||||||
|
|
||||||
$sql = 'SELECT 1
|
|
||||||
FROM `'.bqSQL(_DB_PREFIX_.$this->resourceConfiguration['retrieveData']['table']);
|
|
||||||
if ($assoc['type'] != 'fk_shop')
|
|
||||||
$sql .= '_'.$assoc['type'];
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$def = ObjectModel::getDefinition($this->resourceConfiguration['retrieveData']['className']);
|
|
||||||
if (isset($def['fields']) && isset($def['fields']['id_shop_group']))
|
|
||||||
$check_shop_group = true;
|
|
||||||
}
|
|
||||||
$sql .= '`';
|
|
||||||
|
|
||||||
foreach (self::$shopIDs as $id_shop)
|
|
||||||
$OR[] = ' (id_shop = '.(int)$id_shop.($check_shop_group ? ' OR (id_shop = 0 AND id_shop_group='.(int)Shop::getGroupFromShop((int)$id_shop).')' : '').') ';
|
|
||||||
|
|
||||||
$check = ' WHERE ('.implode('OR', $OR).') AND `'.bqSQL($this->resourceConfiguration['fields']['id']['sqlId']).'` = '.(int)$this->urlSegment[1];
|
|
||||||
if (!Db::getInstance()->getValue($sql.$check))
|
|
||||||
$this->setError(403, 'Bad id_shop : You are not allowed to access this '.$this->resourceConfiguration['retrieveData']['className'].' ('.(int)$this->urlSegment[1].')', 131);
|
|
||||||
}
|
|
||||||
|
|
||||||
//get entity details
|
//get entity details
|
||||||
$object = new $this->resourceConfiguration['retrieveData']['className']((int)$this->urlSegment[1]);
|
$object = new $this->resourceConfiguration['retrieveData']['className']((int)$this->urlSegment[1]);
|
||||||
if ($object->id)
|
if ($object->id)
|
||||||
{
|
{
|
||||||
$objects[] = $object;
|
$objects[] = $object;
|
||||||
return $objects;
|
// Check if Object is accessible for this/those id_shop
|
||||||
|
$assoc = Shop::getAssoTable($this->resourceConfiguration['retrieveData']['table']);
|
||||||
|
if ($assoc !== false)
|
||||||
|
{
|
||||||
|
$check_shop_group = false;
|
||||||
|
|
||||||
|
$sql = 'SELECT 1
|
||||||
|
FROM `'.bqSQL(_DB_PREFIX_.$this->resourceConfiguration['retrieveData']['table']);
|
||||||
|
if ($assoc['type'] != 'fk_shop')
|
||||||
|
$sql .= '_'.$assoc['type'];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$def = ObjectModel::getDefinition($this->resourceConfiguration['retrieveData']['className']);
|
||||||
|
if (isset($def['fields']) && isset($def['fields']['id_shop_group']))
|
||||||
|
$check_shop_group = true;
|
||||||
|
}
|
||||||
|
$sql .= '`';
|
||||||
|
|
||||||
|
foreach (self::$shopIDs as $id_shop)
|
||||||
|
$OR[] = ' (id_shop = '.(int)$id_shop.($check_shop_group ? ' OR (id_shop = 0 AND id_shop_group='.(int)Shop::getGroupFromShop((int)$id_shop).')' : '').') ';
|
||||||
|
|
||||||
|
$check = ' WHERE ('.implode('OR', $OR).') AND `'.bqSQL($this->resourceConfiguration['fields']['id']['sqlId']).'` = '.(int)$this->urlSegment[1];
|
||||||
|
if (!Db::getInstance()->getValue($sql.$check))
|
||||||
|
$this->setError(404, 'This '.$this->resourceConfiguration['retrieveData']['className'].' ('.(int)$this->urlSegment[1].') does not exists on this shop', 131);
|
||||||
|
else
|
||||||
|
return $objects;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif (!count($this->errors))
|
if (!count($this->errors))
|
||||||
{
|
{
|
||||||
$this->objOutput->setStatus(404);
|
$this->objOutput->setStatus(404);
|
||||||
$this->_outputEnabled = false;
|
$this->_outputEnabled = false;
|
||||||
|
|||||||
@@ -503,7 +503,7 @@ class AdminHomeControllerCore extends AdminController
|
|||||||
|
|
||||||
// SHOW TIPS OF THE DAY
|
// SHOW TIPS OF THE DAY
|
||||||
$content = Tools::file_get_contents($protocol.'api.prestashop.com/partner/tipsoftheday/?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser), false, $stream_context);
|
$content = Tools::file_get_contents($protocol.'api.prestashop.com/partner/tipsoftheday/?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser), false, $stream_context);
|
||||||
$content = explode('|', $content);
|
$content = explode('|', utf8_encode($content));
|
||||||
if ($content[0] == 'OK' && Validate::isCleanHtml($content[1]))
|
if ($content[0] == 'OK' && Validate::isCleanHtml($content[1]))
|
||||||
$result['discover_prestashop'] .= '<div id="block_partner_tips">'.$content[1].'</div></div>';
|
$result['discover_prestashop'] .= '<div id="block_partner_tips">'.$content[1].'</div></div>';
|
||||||
|
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ class AdminImagesControllerCore extends AdminController
|
|||||||
public function initMoveImages()
|
public function initMoveImages()
|
||||||
{
|
{
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'safe_mode' => ini_get('safe_mode'),
|
'safe_mode' => Tools::getSafeModeStatus(),
|
||||||
'link_ppreferences' => 'index.php?tab=AdminPPreferences&token='.Tools::getAdminTokenLite('AdminPPreferences').'#PS_LEGACY_IMAGES_on',
|
'link_ppreferences' => 'index.php?tab=AdminPPreferences&token='.Tools::getAdminTokenLite('AdminPPreferences').'#PS_LEGACY_IMAGES_on',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2435,17 +2435,12 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$discount_rate = (float)$info['discount_rate'];
|
$discount_rate = (float)$info['discount_rate'];
|
||||||
$tax_rate = (float)$info['tax_rate'];
|
$tax_rate = (float)$info['tax_rate'];
|
||||||
|
|
||||||
// checks if one product is there only once
|
// checks if one product/attribute is there only once
|
||||||
if (isset($product['id_product']))
|
if (isset($products[$id_product][$id_product_attribute]))
|
||||||
{
|
$this->errors[] = sprintf($this->l('Product/Attribute (%d/%d) cannot be added twice (at line %d).'), $id_product,
|
||||||
if ($product['id_product'] == $id_product_attribute)
|
$id_product_attribute, $current_line + 1);
|
||||||
$this->errors[] = sprintf($this->l('Product (%d/%D) cannot be added twice (at line %d).'), $id_product,
|
|
||||||
$id_product_attribute, $current_line + 1);
|
|
||||||
else
|
|
||||||
$product['id_product'] = $id_product_attribute;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
$product['id_product'] = 0;
|
$products[$id_product][$id_product_attribute] = $quantity_expected;
|
||||||
|
|
||||||
// checks parameters
|
// checks parameters
|
||||||
if (false === ($supplier_reference = ProductSupplier::getProductSupplierReference($id_product, $id_product_attribute, $supply_order->id_supplier)))
|
if (false === ($supplier_reference = ProductSupplier::getProductSupplierReference($id_product, $id_product_attribute, $supply_order->id_supplier)))
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ class AdminLocalizationControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->className = 'Configuration';
|
|
||||||
$this->table = 'configuration';
|
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->fields_options = array(
|
$this->fields_options = array(
|
||||||
|
|||||||
@@ -64,10 +64,20 @@ class AdminLogsControllerCore extends AdminController
|
|||||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'employee e ON (a.id_employee = e.id_employee)';
|
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'employee e ON (a.id_employee = e.id_employee)';
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function processDelete()
|
||||||
|
{
|
||||||
|
return Logger::eraseAllLogs();
|
||||||
|
}
|
||||||
|
|
||||||
public function initToolbar()
|
public function initToolbar()
|
||||||
{
|
{
|
||||||
parent::initToolbar();
|
parent::initToolbar();
|
||||||
|
$this->toolbar_btn['delete'] = array(
|
||||||
|
'short' => 'Erase',
|
||||||
|
'desc' => $this->l('Erase all'),
|
||||||
|
'js' => 'if (confirm(\''.$this->l('Are you sure?').'\')) document.location = \''.$this->context->link->getAdminLink('AdminLogs').'&token='.$this->token.'&deletelog=1\';'
|
||||||
|
);
|
||||||
unset($this->toolbar_btn['new']);
|
unset($this->toolbar_btn['new']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ class AdminManufacturersControllerCore extends AdminController
|
|||||||
'lang' => true,
|
'lang' => true,
|
||||||
'cols' => 60,
|
'cols' => 60,
|
||||||
'rows' => 10,
|
'rows' => 10,
|
||||||
'class' => 'rte',
|
'autoload_rte' => 'rte', //Enable TinyMCE editor for short description
|
||||||
'hint' => $this->l('Invalid characters:').' <>;=#{}'
|
'hint' => $this->l('Invalid characters:').' <>;=#{}'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@@ -266,7 +266,7 @@ class AdminManufacturersControllerCore extends AdminController
|
|||||||
'lang' => true,
|
'lang' => true,
|
||||||
'cols' => 60,
|
'cols' => 60,
|
||||||
'rows' => 10,
|
'rows' => 10,
|
||||||
'class' => 'rte',
|
'autoload_rte' => 'rte', //Enable TinyMCE editor for description
|
||||||
'hint' => $this->l('Invalid characters:').' <>;=#{}'
|
'hint' => $this->l('Invalid characters:').' <>;=#{}'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@@ -730,4 +730,4 @@ class AdminManufacturersControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -778,7 +778,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['update']))
|
if (isset($_GET['update']))
|
||||||
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&updated=1tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : '').$params);
|
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&updated=1tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postProcess()
|
public function postProcess()
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ class AdminPaymentControllerCore extends AdminController
|
|||||||
if ($name_id == 'country'
|
if ($name_id == 'country'
|
||||||
&& isset($module->limited_countries)
|
&& isset($module->limited_countries)
|
||||||
&& !empty($module->limited_countries)
|
&& !empty($module->limited_countries)
|
||||||
|
&& is_array($module->limited_countries)
|
||||||
&& !(in_array(strtoupper($item['iso_code']), array_map('strtoupper', $module->limited_countries))))
|
&& !(in_array(strtoupper($item['iso_code']), array_map('strtoupper', $module->limited_countries))))
|
||||||
$list['items'][$key_item]['check_list'][$key_module] = null;
|
$list['items'][$key_item]['check_list'][$key_module] = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,8 +131,13 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
|||||||
|
|
||||||
$modules = $this->getModules();
|
$modules = $this->getModules();
|
||||||
$module_instance = array();
|
$module_instance = array();
|
||||||
foreach ($modules as $module)
|
foreach ($modules as $m => $module)
|
||||||
|
{
|
||||||
$module_instance[$module['name']] = Module::getInstanceByName($module['name']);
|
$module_instance[$module['name']] = Module::getInstanceByName($module['name']);
|
||||||
|
$modules[$m]['displayName'] = $module_instance[$module['name']]->displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
uasort($modules, array($this, 'checkModulesNames'));
|
||||||
|
|
||||||
$tpl->assign(array(
|
$tpl->assign(array(
|
||||||
'current' => self::$currentIndex,
|
'current' => self::$currentIndex,
|
||||||
@@ -143,6 +148,11 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
|||||||
|
|
||||||
return $tpl->fetch();
|
return $tpl->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkModulesNames($a, $b)
|
||||||
|
{
|
||||||
|
return (bool)($a['displayName'] > $b['displayName']);
|
||||||
|
}
|
||||||
|
|
||||||
protected function getModules()
|
protected function getModules()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ class AdminSuppliersControllerCore extends AdminController
|
|||||||
'rows' => 10,
|
'rows' => 10,
|
||||||
'lang' => true,
|
'lang' => true,
|
||||||
'hint' => $this->l('Invalid characters:').' <>;=#{}',
|
'hint' => $this->l('Invalid characters:').' <>;=#{}',
|
||||||
'desc' => $this->l('Will appear in the supplier list')
|
'desc' => $this->l('Will appear in the supplier list'),
|
||||||
|
'autoload_rte' => 'rte' //Enable TinyMCE editor for short description
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
|
|||||||
@@ -460,7 +460,9 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
if (!$default_language || !Validate::isLanguageIsoCode($default_language))
|
if (!$default_language || !Validate::isLanguageIsoCode($default_language))
|
||||||
return false;
|
return false;
|
||||||
// 1 - Scan mails files
|
// 1 - Scan mails files
|
||||||
$mails = scandir(_PS_MAIL_DIR_.$default_language.'/');
|
$mails = array();
|
||||||
|
if (Tools::file_exists_cache(_PS_MAIL_DIR_.$default_language.'/'))
|
||||||
|
$mails = scandir(_PS_MAIL_DIR_.$default_language.'/');
|
||||||
|
|
||||||
$mails_new_lang = array();
|
$mails_new_lang = array();
|
||||||
|
|
||||||
@@ -579,7 +581,9 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
if (preg_match('#^translations\/'.$iso_code.'\/tabs.php#Ui', $file['filename'], $matches) && Validate::isLanguageIsoCode($iso_code))
|
if (preg_match('#^translations\/'.$iso_code.'\/tabs.php#Ui', $file['filename'], $matches) && Validate::isLanguageIsoCode($iso_code))
|
||||||
{
|
{
|
||||||
// Include array width new translations tabs
|
// Include array width new translations tabs
|
||||||
$tabs = include _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename'];
|
$tabs = array();
|
||||||
|
if (Tools::file_exists_cache(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename']))
|
||||||
|
$tabs = include_once(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename']);
|
||||||
|
|
||||||
foreach ($tabs as $class_name => $translations)
|
foreach ($tabs as $class_name => $translations)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -134,4 +134,12 @@ class ManufacturerControllerCore extends FrontController
|
|||||||
else
|
else
|
||||||
$this->context->smarty->assign('nbManufacturers', 0);
|
$this->context->smarty->assign('nbManufacturers', 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* Get instance of current manufacturer
|
||||||
|
*/
|
||||||
|
public function getManufacturer()
|
||||||
|
{
|
||||||
|
return $this->manufacturer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -936,7 +936,7 @@ CREATE TABLE `PREFIX_manufacturer_lang` (
|
|||||||
`id_manufacturer` int(10) unsigned NOT NULL,
|
`id_manufacturer` int(10) unsigned NOT NULL,
|
||||||
`id_lang` int(10) unsigned NOT NULL,
|
`id_lang` int(10) unsigned NOT NULL,
|
||||||
`description` text,
|
`description` text,
|
||||||
`short_description` varchar(254) default NULL,
|
`short_description` text,
|
||||||
`meta_title` varchar(128) default NULL,
|
`meta_title` varchar(128) default NULL,
|
||||||
`meta_keywords` varchar(255) default NULL,
|
`meta_keywords` varchar(255) default NULL,
|
||||||
`meta_description` varchar(255) default NULL,
|
`meta_description` varchar(255) default NULL,
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
function block_category_1521()
|
function block_category_1521()
|
||||||
{
|
{
|
||||||
if (!Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' '))
|
if (!Db::getInstance()->getValue('SELECT value FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' '))
|
||||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration`
|
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration`
|
||||||
(`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`)
|
(`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`)
|
||||||
VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())');
|
VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())');
|
||||||
else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0'))
|
else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT value FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0 AND `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\''))
|
||||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE\'BLOCK_CATEG_MAX_DEPTH\'');
|
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\'');
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,5 +27,5 @@
|
|||||||
function fix_download_product_feature_active()
|
function fix_download_product_feature_active()
|
||||||
{
|
{
|
||||||
if (Db::getInstance()->getValue('SELECT COUNT(id_product_download) FROM `'._DB_PREFIX_.'product_download` WHERE `active` = 1 ;') > 0)
|
if (Db::getInstance()->getValue('SELECT COUNT(id_product_download) FROM `'._DB_PREFIX_.'product_download` WHERE `active` = 1 ;') > 0)
|
||||||
Configuration::updateGlobaleValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE');
|
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = 1 WHERE `name` LIKE \'PS_VIRTUAL_PROD_FEATURE_ACTIVE\'');
|
||||||
}
|
}
|
||||||
@@ -28,8 +28,9 @@ function generate_ntree()
|
|||||||
{
|
{
|
||||||
$categories = Db::getInstance()->executeS('SELECT id_category, id_parent FROM '._DB_PREFIX_.'category ORDER BY id_parent ASC, position ASC');
|
$categories = Db::getInstance()->executeS('SELECT id_category, id_parent FROM '._DB_PREFIX_.'category ORDER BY id_parent ASC, position ASC');
|
||||||
$categoriesArray = array();
|
$categoriesArray = array();
|
||||||
foreach ($categories AS $category)
|
if (is_array($categories))
|
||||||
$categoriesArray[(int)$category['id_parent']]['subcategories'][(int)$category['id_category']] = 1;
|
foreach ($categories AS $category)
|
||||||
|
$categoriesArray[(int)$category['id_parent']]['subcategories'][(int)$category['id_category']] = 1;
|
||||||
$n = 1;
|
$n = 1;
|
||||||
generate_ntree_subTree($categoriesArray, 1, $n);
|
generate_ntree_subTree($categoriesArray, 1, $n);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ function migrate_orders()
|
|||||||
$reduction_amount_tax_incl = (float)$products['reduction_amount'];
|
$reduction_amount_tax_incl = (float)$products['reduction_amount'];
|
||||||
|
|
||||||
// cart::getTaxesAverageUsed equivalent
|
// cart::getTaxesAverageUsed equivalent
|
||||||
$sum_total_products += $products['total_wt'];
|
$sum_total_products += $products['total_price'];
|
||||||
|
|
||||||
$sum_tax_amount += $products['total_wt'] - $products['total_price'];
|
$sum_tax_amount += $products['total_wt'] - $products['total_price'];
|
||||||
|
|
||||||
$order_details['reduction_amount_tax_incl'] = $reduction_amount_tax_incl;
|
$order_details['reduction_amount_tax_incl'] = $reduction_amount_tax_incl;
|
||||||
@@ -119,12 +120,13 @@ function migrate_orders()
|
|||||||
|
|
||||||
$average_tax_used = 1;
|
$average_tax_used = 1;
|
||||||
if ($sum_total_products > 0)
|
if ($sum_total_products > 0)
|
||||||
$average_tax_used += ($sum_tax_amount / $sum_total_products) * 0.01;
|
$average_tax_used += $sum_tax_amount / $sum_total_products;
|
||||||
|
$average_tax_used = round($average_tax_used, 4);
|
||||||
$carrier_tax_rate = 1 + ((float)$order['carrier_tax_rate'] / 100);
|
$carrier_tax_rate = 1;
|
||||||
|
if (isset($order['carrier_tax_rate']))
|
||||||
|
$carrier_tax_rate + ((float)$order['carrier_tax_rate'] / 100);
|
||||||
|
|
||||||
$total_discount_tax_excl = $order['total_discounts'] / $average_tax_used;
|
$total_discount_tax_excl = $order['total_discounts'] / $average_tax_used;
|
||||||
|
|
||||||
$order['total_discounts_tax_incl'] = (float)$order['total_discounts'];
|
$order['total_discounts_tax_incl'] = (float)$order['total_discounts'];
|
||||||
$order['total_discounts_tax_excl'] = (float)$total_discount_tax_excl;
|
$order['total_discounts_tax_excl'] = (float)$total_discount_tax_excl;
|
||||||
|
|
||||||
@@ -321,5 +323,4 @@ function mo_setProductPrices($row, $tax_calculation_method)
|
|||||||
$row['total_price'] = $row['product_quantity'] * $row['product_price'];
|
$row['total_price'] = $row['product_quantity'] * $row['product_price'];
|
||||||
|
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,14 +44,14 @@ function move_translations_module_file()
|
|||||||
foreach ($modules as $module_name)
|
foreach ($modules as $module_name)
|
||||||
{
|
{
|
||||||
// Check if is a good module
|
// Check if is a good module
|
||||||
if (in_array($module_name, array('.', '..', '.svn', '.htaccess', 'index.php', 'autoupgrade')))
|
if (in_array($module_name, array('.', '..', '.svn', '.htaccess', 'index.php', 'autoupgrade')) || !is_dir(_PS_MODULE_DIR_.'/'.$module_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
foreach ($languages as $lang)
|
foreach ($languages as $lang)
|
||||||
{
|
{
|
||||||
// Name for the old file and the new file
|
// Name for the old file and the new file
|
||||||
$old_file = _PS_MODULE_DIR_.$module_name.'/'.$lang['iso_code'].'.php';
|
$old_file = _PS_MODULE_DIR_.$module_name.'/'.$lang['iso_code'].'.php';
|
||||||
if (!file_exists($old_file))
|
if (!@file_exists($old_file))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$dir_translations = _PS_MODULE_DIR_.$module_name.'/translations/';
|
$dir_translations = _PS_MODULE_DIR_.$module_name.'/translations/';
|
||||||
@@ -61,7 +61,7 @@ function move_translations_module_file()
|
|||||||
if (!is_dir($dir_translations))
|
if (!is_dir($dir_translations))
|
||||||
$res &= mkdir($dir_translations, 0777);
|
$res &= mkdir($dir_translations, 0777);
|
||||||
|
|
||||||
if (!rename($old_file, $new_file))
|
if (!@rename($old_file, $new_file))
|
||||||
{
|
{
|
||||||
$error_list[] = $module_name.' - '.$lang['iso_code']."<br/>\r\n";
|
$error_list[] = $module_name.' - '.$lang['iso_code']."<br/>\r\n";
|
||||||
$res &= false;
|
$res &= false;
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ function p15015_blockadvertising_extension()
|
|||||||
define('_PS_ROOT_DIR_', realpath(INSTALL_PATH.'/../'));
|
define('_PS_ROOT_DIR_', realpath(INSTALL_PATH.'/../'));
|
||||||
|
|
||||||
// Try to update with the extension of the image that exists in the module directory
|
// Try to update with the extension of the image that exists in the module directory
|
||||||
if (file_exists(_PS_ROOT_DIR_.'modules/blockadvertising'))
|
if (@file_exists(_PS_ROOT_DIR_.'/modules/blockadvertising'))
|
||||||
foreach (scandir(_PS_ROOT_DIR_.'modules/blockadvertising') as $file)
|
foreach (@scandir(_PS_ROOT_DIR_.'/modules/blockadvertising') as $file)
|
||||||
if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png')))
|
if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png')))
|
||||||
Db::getInstance()->execute('
|
Db::getInstance()->execute('
|
||||||
REPLACE INTO `'._DB_PREFIX_.'configuration` (name, value)
|
REPLACE INTO `'._DB_PREFIX_.'configuration` (name, value)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ function p15018_change_image_types()
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$option = (bool)Db::getInstance()->getValue('SELECT id_theme FROM `'._DB_PREFIX_.'theme` WHERE directory != "default"');
|
$option = (bool)Db::getInstance()->getValue('SELECT id_theme FROM `'._DB_PREFIX_.'theme` WHERE directory != "default" AND directory != "prestashop"');
|
||||||
|
|
||||||
// If there is another theme than the default one, duplicate
|
// If there is another theme than the default one, duplicate
|
||||||
if ($option)
|
if ($option)
|
||||||
|
|||||||
@@ -26,12 +26,12 @@
|
|||||||
|
|
||||||
function update_genders_images()
|
function update_genders_images()
|
||||||
{
|
{
|
||||||
if (file_exists(_PS_ROOT_DIR_.'/img/genders/Mr.jpg'))
|
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Mr.jpg'))
|
||||||
@rename(_PS_ROOT_DIR_.'/img/genders/Mr.jpg', _PS_ROOT_DIR_.'/img/genders/1.jpg');
|
@rename(_PS_ROOT_DIR_.'/img/genders/Mr.jpg', _PS_ROOT_DIR_.'/img/genders/1.jpg');
|
||||||
if (file_exists(_PS_ROOT_DIR_.'/img/genders/Ms.jpg'))
|
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Ms.jpg'))
|
||||||
@rename(_PS_ROOT_DIR_.'/img/genders/Ms.jpg', _PS_ROOT_DIR_.'/img/genders/2.jpg');
|
@rename(_PS_ROOT_DIR_.'/img/genders/Ms.jpg', _PS_ROOT_DIR_.'/img/genders/2.jpg');
|
||||||
if (file_exists(_PS_ROOT_DIR_.'/img/genders/Miss.jpg'))
|
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/Miss.jpg'))
|
||||||
@rename(_PS_ROOT_DIR_.'/img/genders/Miss.jpg', _PS_ROOT_DIR_.'/img/genders/3.jpg');
|
@rename(_PS_ROOT_DIR_.'/img/genders/Miss.jpg', _PS_ROOT_DIR_.'/img/genders/3.jpg');
|
||||||
if (file_exists(_PS_ROOT_DIR_.'genders/unknown.jpg'))
|
if (@file_exists(_PS_ROOT_DIR_.'/img/genders/unknown.jpg'))
|
||||||
@rename(_PS_ROOT_DIR_.'/img/genders/unknown.jpg', _PS_ROOT_DIR_.'/img/genders/Unknown.jpg');
|
@rename(_PS_ROOT_DIR_.'/img/genders/unknown.jpg', _PS_ROOT_DIR_.'/img/genders/Unknown.jpg');
|
||||||
}
|
}
|
||||||
@@ -57,6 +57,7 @@ function update_order_canada()
|
|||||||
$default_price_display_method = Db::getInstance()->getValue('SELECT price_display_method
|
$default_price_display_method = Db::getInstance()->getValue('SELECT price_display_method
|
||||||
FROM `'._DB_PREFIX_.'group` WHERE id_group=1');
|
FROM `'._DB_PREFIX_.'group` WHERE id_group=1');
|
||||||
$values = '';
|
$values = '';
|
||||||
|
if (is_array($id_order_list))
|
||||||
foreach ($id_order_list as $order)
|
foreach ($id_order_list as $order)
|
||||||
{
|
{
|
||||||
$amount = array();
|
$amount = array();
|
||||||
|
|||||||
@@ -29,17 +29,18 @@ function update_order_messages()
|
|||||||
$step = 3000;
|
$step = 3000;
|
||||||
$count_messages = Db::getInstance()->getValue('SELECT count(id_message) FROM '._DB_PREFIX_.'message');
|
$count_messages = Db::getInstance()->getValue('SELECT count(id_message) FROM '._DB_PREFIX_.'message');
|
||||||
$nb_loop = $start = 0;
|
$nb_loop = $start = 0;
|
||||||
|
$pattern = '<br|&[a-zA-Z]{1,8};';
|
||||||
if($count_messages > 0)
|
if($count_messages > 0)
|
||||||
$nb_loop = ceil($count_messages / $step);
|
$nb_loop = ceil($count_messages / $step);
|
||||||
for($i = 0; $i < $nb_loop; $i++)
|
for($i = 0; $i < $nb_loop; $i++)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id_message, message FROM `'._DB_PREFIX_.'message` WHERE message REGEXP \'<br|&[^;]{1,8}\' LIMIT '.(int)$start.', '.(int)$step;
|
$sql = 'SELECT id_message, message FROM `'._DB_PREFIX_.'message` WHERE message REGEXP \''.pSQL($pattern, true).'\' LIMIT '.(int)$start.', '.(int)$step;
|
||||||
if ($messages = Db::getInstance()->query($sql))
|
if ($messages = Db::getInstance()->query($sql))
|
||||||
while ($message = Db::getInstance()->nextRow($messages))
|
while ($message = Db::getInstance()->nextRow($messages))
|
||||||
{
|
{
|
||||||
if(is_array($message))
|
if(is_array($message))
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE `'._DB_PREFIX_.'message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(br2nl($message['message']))).'\'
|
$sql = 'UPDATE `'._DB_PREFIX_.'message` SET message = \''.pSQL(preg_replace('/'.$pattern.'/', '', Tools::htmlentitiesDecodeUTF8(br2nl($message['message'])))).'\'
|
||||||
WHERE id_message = '.(int)$message['id_message'];
|
WHERE id_message = '.(int)$message['id_message'];
|
||||||
$result = Db::getInstance()->execute($sql);
|
$result = Db::getInstance()->execute($sql);
|
||||||
}
|
}
|
||||||
@@ -50,13 +51,13 @@ function update_order_messages()
|
|||||||
$nb_loop = ceil($count_messages / $step);
|
$nb_loop = ceil($count_messages / $step);
|
||||||
for($i = 0; $i < $nb_loop; $i++)
|
for($i = 0; $i < $nb_loop; $i++)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id_customer_message, message FROM `'._DB_PREFIX_.'customer_message` WHERE message REGEXP \'<br|&[^;]{1,8}\' LIMIT '.(int)$start.', '.(int)$step;
|
$sql = 'SELECT id_customer_message, message FROM `'._DB_PREFIX_.'customer_message` WHERE message REGEXP \''.pSQL($pattern, true).'\' LIMIT '.(int)$start.', '.(int)$step;
|
||||||
if ($messages = Db::getInstance()->query($sql))
|
if ($messages = Db::getInstance()->query($sql))
|
||||||
while ($message = Db::getInstance()->nextRow($messages))
|
while ($message = Db::getInstance()->nextRow($messages))
|
||||||
{
|
{
|
||||||
if(is_array($message))
|
if(is_array($message))
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&', '&', $message['message']))).'\'
|
$sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(preg_replace('/'.$pattern.'/', '', Tools::htmlentitiesDecodeUTF8(str_replace('&', '&', $message['message'])))).'\'
|
||||||
WHERE id_customer_message = '.(int)$message['id_customer_message'];
|
WHERE id_customer_message = '.(int)$message['id_customer_message'];
|
||||||
Db::getInstance()->execute($sql);
|
Db::getInstance()->execute($sql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
SET NAMES 'utf8';
|
SET NAMES 'utf8';
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `PREFIX_group_shop`;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `PREFIX_group_shop` (
|
CREATE TABLE IF NOT EXISTS `PREFIX_group_shop` (
|
||||||
`id_group_shop` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id_group_shop` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(64) CHARACTER SET utf8 NOT NULL,
|
`name` varchar(64) CHARACTER SET utf8 NOT NULL,
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
UPDATE `PREFIX_meta` SET `page` = 'contact' WHERE `page` = 'contact-form';
|
UPDATE `PREFIX_meta` SET `page` = 'contact' WHERE `page` = 'contact-form';
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `PREFIX_shop_group`;
|
||||||
|
|
||||||
RENAME TABLE `PREFIX_group_shop` TO `PREFIX_shop_group`;
|
RENAME TABLE `PREFIX_group_shop` TO `PREFIX_shop_group`;
|
||||||
ALTER TABLE `PREFIX_shop_group` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT;
|
ALTER TABLE `PREFIX_shop_group` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||||
ALTER TABLE `PREFIX_shop` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) UNSIGNED NOT NULL;
|
ALTER TABLE `PREFIX_shop` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) UNSIGNED NOT NULL;
|
||||||
|
|||||||
@@ -34,6 +34,6 @@ ALTER TABLE `PREFIX_product_shop` DROP INDEX `date_add`, ADD INDEX `date_add` (`
|
|||||||
|
|
||||||
UPDATE `PREFIX_hook` SET `live_edit` = '1' WHERE `name` LIKE 'leftcolumn';
|
UPDATE `PREFIX_hook` SET `live_edit` = '1' WHERE `name` LIKE 'leftcolumn';
|
||||||
|
|
||||||
UPDATE `PREFIX_configuration` SET `name` = '0' WHERE `name` LIKE 'PS_LEGACY_IMAGES' AND `value` LIKE '1';
|
UPDATE `PREFIX_configuration` SET `value` = '0' WHERE `name` LIKE 'PS_LEGACY_IMAGES' AND `value` = 1;
|
||||||
|
|
||||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_SMARTY_CONSOLE_KEY', 'SMARTY_DEBUG', NOW(), NOW());
|
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_SMARTY_CONSOLE_KEY', 'SMARTY_DEBUG', NOW(), NOW());
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `PREFIX_manufacturer_lang` CHANGE `short_description` `short_description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
|
||||||
+38
@@ -294,6 +294,44 @@ function removeQuotes(value)
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a MessageBox
|
||||||
|
* @param {string} msg
|
||||||
|
* @param {string} title (optional)
|
||||||
|
*/
|
||||||
|
function fancyMsgBox(msg, title)
|
||||||
|
{
|
||||||
|
if (title) msg = "<h2>" + title + "</h2><p>" + msg + "</p>";
|
||||||
|
msg += "<br/><p class=\"submit\" style=\"text-align:right; padding-bottom: 0\"><input class=\"button\" type=\"button\" value=\"OK\" onclick=\"$.fancybox.close();\" /></p>";
|
||||||
|
$.fancybox( msg, {'autoDimensions': false, 'width': 500, 'height': 'auto', 'transitionIn': 'none', 'transitionOut': 'none'} );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a messageDialog with different buttons including a callback for each one
|
||||||
|
* @param {string} question
|
||||||
|
* @param {mixed} title Optional title for the dialog box. Send false if you don't want any title
|
||||||
|
* @param {object} buttons Associative array containg a list of {buttonCaption: callbackFunctionName, ...}. Use an empty space instead of function name for no callback
|
||||||
|
* @param {mixed} otherParams Optional data sent to the callback function
|
||||||
|
*/
|
||||||
|
function fancyChooseBox(question, title, buttons, otherParams)
|
||||||
|
{
|
||||||
|
var msg, funcName, action;
|
||||||
|
if (title) msg = "<h2>" + title + "</h2><p>" + question + "</p>";
|
||||||
|
msg += "<br/><p class=\"submit\" style=\"text-align:right; padding-bottom: 0\">";
|
||||||
|
var i = 0;
|
||||||
|
for (var caption in buttons) {
|
||||||
|
if (!buttons.hasOwnProperty(caption)) continue;
|
||||||
|
funcName = buttons[caption];
|
||||||
|
if (typeof otherParams == 'undefined') otherParams = 0;
|
||||||
|
otherParams = escape(JSON.stringify(otherParams));
|
||||||
|
action = funcName ? "$.fancybox.close();window['" + funcName + "'](JSON.parse(unescape('" + otherParams + "')), " + i + ")" : "$.fancybox.close()";
|
||||||
|
msg += '<input class="button" style="margin-right: 5px" type="button" value="' + caption + '" onclick="' + action + '" />';
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
msg += "</p>";
|
||||||
|
$.fancybox( msg, {'autoDimensions': false, 'width': 500, 'height': 'auto', 'transitionIn': 'none', 'transitionOut': 'none'} );
|
||||||
|
}
|
||||||
|
|
||||||
//On dom ready
|
//On dom ready
|
||||||
$().ready(function()
|
$().ready(function()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -214,26 +214,46 @@ var ajaxCart = {
|
|||||||
$element = $('#bigpic');
|
$element = $('#bigpic');
|
||||||
var $picture = $element.clone();
|
var $picture = $element.clone();
|
||||||
var pictureOffsetOriginal = $element.offset();
|
var pictureOffsetOriginal = $element.offset();
|
||||||
|
pictureOffsetOriginal.right = $(window).innerWidth() - pictureOffsetOriginal.left - $element.width();
|
||||||
|
|
||||||
if ($picture.size())
|
if ($picture.length)
|
||||||
$picture.css({'position': 'absolute', 'top': pictureOffsetOriginal.top, 'left': pictureOffsetOriginal.left});
|
{
|
||||||
|
$picture.css({
|
||||||
|
position: 'absolute',
|
||||||
|
top: pictureOffsetOriginal.top,
|
||||||
|
right: pictureOffsetOriginal.right
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var pictureOffset = $picture.offset();
|
var pictureOffset = $picture.offset();
|
||||||
if ($('#cart_block')[0] && $('#cart_block').offset().top && $('#cart_block').offset().left)
|
var cartBlock = $('#cart_block');
|
||||||
var cartBlockOffset = $('#cart_block').offset();
|
if (!$('#cart_block')[0] || !$('#cart_block').offset().top || !$('#cart_block').offset().left)
|
||||||
else
|
cartBlock = $('#shopping_cart');
|
||||||
var cartBlockOffset = $('#shopping_cart').offset();
|
var cartBlockOffset = cartBlock.offset();
|
||||||
|
cartBlockOffset.right = $(window).innerWidth() - cartBlockOffset.left - cartBlock.width();
|
||||||
|
|
||||||
// Check if the block cart is activated for the animation
|
// Check if the block cart is activated for the animation
|
||||||
if (cartBlockOffset != undefined && $picture.size())
|
if (cartBlockOffset != undefined && $picture.length)
|
||||||
{
|
{
|
||||||
$picture.appendTo('body');
|
$picture.appendTo('body');
|
||||||
$picture.css({ 'position': 'absolute', 'top': $picture.css('top'), 'left': $picture.css('left'), 'z-index': 4242 })
|
$picture
|
||||||
.animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000)
|
.css({
|
||||||
.fadeOut(100, function() {
|
position: 'absolute',
|
||||||
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
top: pictureOffsetOriginal.top,
|
||||||
$(this).remove();
|
right: pictureOffsetOriginal.right,
|
||||||
});
|
zIndex: 4242
|
||||||
|
})
|
||||||
|
.animate({
|
||||||
|
width: $element.attr('width')*0.66,
|
||||||
|
height: $element.attr('height')*0.66,
|
||||||
|
opacity: 0.2,
|
||||||
|
top: cartBlockOffset.top + 30,
|
||||||
|
right: cartBlockOffset.right + 15
|
||||||
|
}, 1000)
|
||||||
|
.fadeOut(100, function() {
|
||||||
|
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
||||||
|
|||||||
@@ -445,10 +445,7 @@ class BlockLayered extends Module
|
|||||||
static $_MODULES = array();
|
static $_MODULES = array();
|
||||||
global $_MODULE;
|
global $_MODULE;
|
||||||
|
|
||||||
if (version_compare(_PS_VERSION_,'1.5','>'))
|
|
||||||
$file = _PS_MODULE_DIR_.$this->name.'/translations/'.Language::getIsoById($id_lang).'.php';
|
$file = _PS_MODULE_DIR_.$this->name.'/translations/'.Language::getIsoById($id_lang).'.php';
|
||||||
else
|
|
||||||
$file = _PS_MODULE_DIR_.$this->name.'/'.Language::getIsoById($id_lang).'.php';
|
|
||||||
|
|
||||||
if (!array_key_exists($id_lang, $_MODULES))
|
if (!array_key_exists($id_lang, $_MODULES))
|
||||||
{
|
{
|
||||||
@@ -2393,11 +2390,13 @@ class BlockLayered extends Module
|
|||||||
MAX(image_shop.`id_image`) id_image,
|
MAX(image_shop.`id_image`) id_image,
|
||||||
il.legend,
|
il.legend,
|
||||||
m.name manufacturer_name,
|
m.name manufacturer_name,
|
||||||
DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB(NOW(), INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new
|
DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB(NOW(), INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new,
|
||||||
|
stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity
|
||||||
FROM `'._DB_PREFIX_.'category_product` cp
|
FROM `'._DB_PREFIX_.'category_product` cp
|
||||||
LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category)
|
LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category)
|
||||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product`
|
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product`
|
||||||
'.Shop::addSqlAssociation('product', 'p').'
|
'.Shop::addSqlAssociation('product', 'p').'
|
||||||
|
'.Product::sqlStock('p', null, false, Context::getContext()->shop).'
|
||||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.')
|
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.')
|
||||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`)'.
|
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`)'.
|
||||||
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
|
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
|
||||||
|
|||||||
@@ -111,7 +111,10 @@ class BlockNewProducts extends Module
|
|||||||
{
|
{
|
||||||
if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
|
if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
|
||||||
{
|
{
|
||||||
if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY') && !($newProducts = Product::getNewProducts((int)$params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'))))
|
if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
|
||||||
|
return;
|
||||||
|
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR'));
|
||||||
|
if (!$newProducts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->smarty->assign(array(
|
$this->smarty->assign(array(
|
||||||
@@ -151,4 +154,4 @@ class BlockNewProducts extends Module
|
|||||||
{
|
{
|
||||||
$this->_clearCache('blocknewproducts.tpl');
|
$this->_clearCache('blocknewproducts.tpl');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,6 +221,8 @@ class Blocktopmenu extends Module
|
|||||||
|
|
||||||
// BEGIN SUPPLIER
|
// BEGIN SUPPLIER
|
||||||
$this->_html .= '<optgroup label="'.$this->l('Supplier').'">';
|
$this->_html .= '<optgroup label="'.$this->l('Supplier').'">';
|
||||||
|
// Option to show all Suppliers
|
||||||
|
$this->_html .= '<option value="ALLSUP0">'.$this->l('All suppliers').'</option>';
|
||||||
$suppliers = Supplier::getSuppliers(false, $id_lang);
|
$suppliers = Supplier::getSuppliers(false, $id_lang);
|
||||||
foreach ($suppliers as $supplier)
|
foreach ($suppliers as $supplier)
|
||||||
$this->_html .= '<option value="SUP'.$supplier['id_supplier'].'">'.$spacer.$supplier['name'].'</option>';
|
$this->_html .= '<option value="SUP'.$supplier['id_supplier'].'">'.$spacer.$supplier['name'].'</option>';
|
||||||
@@ -228,6 +230,8 @@ class Blocktopmenu extends Module
|
|||||||
|
|
||||||
// BEGIN Manufacturer
|
// BEGIN Manufacturer
|
||||||
$this->_html .= '<optgroup label="'.$this->l('Manufacturer').'">';
|
$this->_html .= '<optgroup label="'.$this->l('Manufacturer').'">';
|
||||||
|
// Option to show all Manufacturers
|
||||||
|
$this->_html .= '<option value="ALLMAN0">'.$this->l('All manufacturers').'</option>';
|
||||||
$manufacturers = Manufacturer::getManufacturers(false, $id_lang);
|
$manufacturers = Manufacturer::getManufacturers(false, $id_lang);
|
||||||
foreach ($manufacturers as $manufacturer)
|
foreach ($manufacturers as $manufacturer)
|
||||||
$this->_html .= '<option value="MAN'.$manufacturer['id_manufacturer'].'">'.$spacer.$manufacturer['name'].'</option>';
|
$this->_html .= '<option value="MAN'.$manufacturer['id_manufacturer'].'">'.$spacer.$manufacturer['name'].'</option>';
|
||||||
@@ -472,12 +476,22 @@ class Blocktopmenu extends Module
|
|||||||
$this->_html .= '<option value="CMS_CAT'.$id.'">'.$category->name.'</option>'.PHP_EOL;
|
$this->_html .= '<option value="CMS_CAT'.$id.'">'.$category->name.'</option>'.PHP_EOL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Case to handle the option to show all Manufacturers
|
||||||
|
case 'ALLMAN':
|
||||||
|
$this->_html .= '<option value="ALLMAN0">'.$this->l('All manufacturers').'</option>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'MAN':
|
case 'MAN':
|
||||||
$manufacturer = new Manufacturer((int)$id, (int)$id_lang);
|
$manufacturer = new Manufacturer((int)$id, (int)$id_lang);
|
||||||
if (Validate::isLoadedObject($manufacturer))
|
if (Validate::isLoadedObject($manufacturer))
|
||||||
$this->_html .= '<option value="MAN'.$id.'">'.$manufacturer->name.'</option>'.PHP_EOL;
|
$this->_html .= '<option value="MAN'.$id.'">'.$manufacturer->name.'</option>'.PHP_EOL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Case to handle the option to show all Suppliers
|
||||||
|
case 'ALLSUP':
|
||||||
|
$this->_html .= '<option value="ALLSUP0">'.$this->l('All suppliers').'</option>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'SUP':
|
case 'SUP':
|
||||||
$supplier = new Supplier((int)$id, (int)$id_lang);
|
$supplier = new Supplier((int)$id, (int)$id_lang);
|
||||||
if (Validate::isLoadedObject($supplier))
|
if (Validate::isLoadedObject($supplier))
|
||||||
@@ -549,6 +563,16 @@ class Blocktopmenu extends Module
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Case to handle the option to show all Manufacturers
|
||||||
|
case 'ALLMAN':
|
||||||
|
$link = new Link;
|
||||||
|
$this->_menu .= '<li><a href="'.$link->getPageLink('manufacturer').'">'.$this->l('All manufacturers').'</a><ul>'.PHP_EOL;
|
||||||
|
$manufacturers = Manufacturer::getManufacturers();
|
||||||
|
foreach ($manufacturers as $key => $manufacturer)
|
||||||
|
$this->_menu .= '<li><a href="'.$link->getManufacturerLink((int)$manufacturer['id_manufacturer'], $manufacturer['link_rewrite']).'">'.$manufacturer['name'].'</a></li>'.PHP_EOL;
|
||||||
|
$this->_menu .= '</ul>';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'MAN':
|
case 'MAN':
|
||||||
$selected = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
|
$selected = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
|
||||||
$manufacturer = new Manufacturer((int)$id, (int)$id_lang);
|
$manufacturer = new Manufacturer((int)$id, (int)$id_lang);
|
||||||
@@ -563,6 +587,16 @@ class Blocktopmenu extends Module
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Case to handle the option to show all Suppliers
|
||||||
|
case 'ALLSUP':
|
||||||
|
$link = new Link;
|
||||||
|
$this->_menu .= '<li><a href="'.$link->getPageLink('supplier').'">'.$this->l('All suppliers').'</a><ul>'.PHP_EOL;
|
||||||
|
$suppliers = Supplier::getSuppliers();
|
||||||
|
foreach ($suppliers as $key => $supplier)
|
||||||
|
$this->_menu .= '<li><a href="'.$link->getSupplierLink((int)$supplier['id_supplier'], $supplier['link_rewrite']).'">'.$supplier['name'].'</a></li>'.PHP_EOL;
|
||||||
|
$this->_menu .= '</ul>';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'SUP':
|
case 'SUP':
|
||||||
$selected = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
|
$selected = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
|
||||||
$supplier = new Supplier((int)$id, (int)$id_lang);
|
$supplier = new Supplier((int)$id, (int)$id_lang);
|
||||||
@@ -896,4 +930,4 @@ class Blocktopmenu extends Module
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ class importerosc extends ImportModule
|
|||||||
$keyLanguage = 'id_lang';
|
$keyLanguage = 'id_lang';
|
||||||
$identifier = 'id_category';
|
$identifier = 'id_category';
|
||||||
$categories = $this->executeS('
|
$categories = $this->executeS('
|
||||||
SELECT c.categories_id as id_category, c.parent_id as id_parent, level as level_depth, cd.language_id as id_lang, cd.categories_name as name , 1 as active, categories_image as images
|
SELECT c.categories_id as id_category, c.parent_id as id_parent, level as level_depth, cd.language_id as id_lang, cd.categories_name as name , 1 as active, categories_image as images, c.date_added as date_add
|
||||||
FROM `'.bqSQL($this->prefix).'categories` c
|
FROM `'.bqSQL($this->prefix).'categories` c
|
||||||
LEFT JOIN `'.bqSQL($this->prefix).'categories_description` cd ON (c.categories_id = cd.categories_id)
|
LEFT JOIN `'.bqSQL($this->prefix).'categories_description` cd ON (c.categories_id = cd.categories_id)
|
||||||
WHERE cd.categories_name IS NOT NULL AND cd.language_id IS NOT NULL
|
WHERE cd.categories_name IS NOT NULL AND cd.language_id IS NOT NULL
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ $(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// Form element
|
// Form element
|
||||||
|
|
||||||
url_options = parseInt(productcomments_url_rewrite) ? '?' : '&';
|
url_options = parseInt(productcomments_url_rewrite) ? '?' : '&';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
|
url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
|
||||||
data: $('#fancybox-content form').serialize(),
|
data: $('#id_new_comment_form').serialize(),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
headers: { "cache-control": "no-cache" },
|
headers: { "cache-control": "no-cache" },
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@@ -68,7 +68,9 @@ $(function() {
|
|||||||
if (data.result)
|
if (data.result)
|
||||||
{
|
{
|
||||||
$.fancybox.close();
|
$.fancybox.close();
|
||||||
document.location.href = document.location.href;
|
var buttons = {};
|
||||||
|
buttons[productcomment_ok] = "productcommentRefreshPage";
|
||||||
|
fancyChooseBox(productcomment_added, productcomment_title, buttons);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -83,3 +85,7 @@ $(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function productcommentRefreshPage() {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
@@ -89,7 +89,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
<!-- Fancybox -->
|
<!-- Fancybox -->
|
||||||
<div style="display: none;">
|
<div style="display: none;">
|
||||||
<div id="new_comment_form">
|
<div id="new_comment_form">
|
||||||
<form action="#">
|
<form id="id_new_comment_form" action="#">
|
||||||
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
||||||
<div class="product clearfix">
|
<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'}" />
|
<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'}" />
|
||||||
@@ -102,7 +102,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
<div class="new_comment_form_content">
|
<div class="new_comment_form_content">
|
||||||
<h2>{l s='Write your review' mod='productcomments'}</h2>
|
<h2>{l s='Write your review' mod='productcomments'}</h2>
|
||||||
|
|
||||||
<div id="new_comment_form_error" class="error" style="display: none;">
|
<div id="new_comment_form_error" class="error" style="display: none; padding: 15px 25px">
|
||||||
<ul></ul>
|
<ul></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div id="new_comment_form_footer">
|
<div id="new_comment_form_footer">
|
||||||
<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}'></input>
|
<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}' />
|
||||||
<p class="fl required"><sup>*</sup> {l s='Required fields' mod='productcomments'}</p>
|
<p class="fl required"><sup>*</sup> {l s='Required fields' mod='productcomments'}</p>
|
||||||
<p class="fr">
|
<p class="fr">
|
||||||
<button id="submitNewMessage" name="submitMessage" type="submit">{l s='Send' mod='productcomments'}</button>
|
<button id="submitNewMessage" name="submitMessage" type="submit">{l s='Send' mod='productcomments'}</button>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class SEKeywords extends ModuleGraph
|
|||||||
|
|
||||||
public function hookTop($params)
|
public function hookTop($params)
|
||||||
{
|
{
|
||||||
if (!isset($_SERVER['HTTP_REFERER']) || strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost(false, false)))
|
if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], Tools::getHttpHost(false, false) == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ($keywords = $this->getKeywords($_SERVER['HTTP_REFERER']))
|
if ($keywords = $this->getKeywords($_SERVER['HTTP_REFERER']))
|
||||||
@@ -161,6 +161,7 @@ class SEKeywords extends ModuleGraph
|
|||||||
$parsedUrl = parse_url($url);
|
$parsedUrl = parse_url($url);
|
||||||
if (!isset($parsedUrl['query']) && isset($parsedUrl['fragment']))
|
if (!isset($parsedUrl['query']) && isset($parsedUrl['fragment']))
|
||||||
$parsedUrl['query'] = $parsedUrl['fragment'];
|
$parsedUrl['query'] = $parsedUrl['fragment'];
|
||||||
|
|
||||||
if (!isset($parsedUrl['query']))
|
if (!isset($parsedUrl['query']))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -172,13 +173,17 @@ class SEKeywords extends ModuleGraph
|
|||||||
if (strstr($parsedUrl['host'], $host))
|
if (strstr($parsedUrl['host'], $host))
|
||||||
{
|
{
|
||||||
$kArray = array();
|
$kArray = array();
|
||||||
preg_match('/[^a-z]'.$varname.'=.+\&'.'/U', $parsedUrl['query'], $kArray);
|
preg_match('/[^a-zA-Z&]?'.$varname.'=.*\&'.'/U', $parsedUrl['query'], $kArray);
|
||||||
|
|
||||||
if (!isset($kArray[0]) || empty($kArray[0]))
|
if (!isset($kArray[0]) || empty($kArray[0]))
|
||||||
preg_match('/[^a-z]'.$varname.'=.+$'.'/', $parsedUrl['query'], $kArray);
|
preg_match('/[^a-zA-Z&]?'.$varname.'=.*$'.'/', $parsedUrl['query'], $kArray);
|
||||||
|
|
||||||
if (!isset($kArray[0]) || empty($kArray[0]))
|
if (!isset($kArray[0]) || empty($kArray[0]))
|
||||||
return false;
|
return false;
|
||||||
if ($kArray[0][0] == '&')
|
|
||||||
|
if ($kArray[0][0] == '&' && Tools::strlen($kArray[0]) == 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return urldecode(str_replace('+', ' ', ltrim(substr(rtrim($kArray[0], '&'), strlen($varname) + 1), '=')));
|
return urldecode(str_replace('+', ' ', ltrim(substr(rtrim($kArray[0], '&'), strlen($varname) + 1), '=')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
<script text="javascript">
|
<script type="text/javascript">
|
||||||
{literal}
|
{literal}
|
||||||
$('document').ready(function(){
|
$('document').ready(function(){
|
||||||
$('#send_friend_button').fancybox({
|
$('#send_friend_button').fancybox({
|
||||||
@@ -49,8 +49,11 @@ $('document').ready(function(){
|
|||||||
headers: {"cache-control": "no-cache"},
|
headers: {"cache-control": "no-cache"},
|
||||||
data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: unescape(JSON.stringify(datas).replace(/\\u/g, '%u'))},{/literal}{literal}
|
data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: unescape(JSON.stringify(datas).replace(/\\u/g, '%u'))},{/literal}{literal}
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(result){
|
success: function(result) {
|
||||||
$.fancybox.close();
|
$.fancybox.close();
|
||||||
|
var msg = result ? "{/literal}{l s='Your e-mail has been sent successfully' mod='sendtoafriend'}{literal}" : "{/literal}{l s='Your e-mail could not be sent. Please check the e-mail address and try again.' mod='sendtoafriend'}{literal}";
|
||||||
|
var title = "{/literal}{l s='Send to a friend' mod='sendtoafriend'}{literal}";
|
||||||
|
fancyMsgBox(msg, title);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -77,6 +80,7 @@ $('document').ready(function(){
|
|||||||
|
|
||||||
<div class="send_friend_form_content" id="send_friend_form_content">
|
<div class="send_friend_form_content" id="send_friend_form_content">
|
||||||
<div id="send_friend_form_error"></div>
|
<div id="send_friend_form_error"></div>
|
||||||
|
<div id="send_friend_form_success"></div>
|
||||||
<div class="form_container">
|
<div class="form_container">
|
||||||
<p class="intro_form">{l s='Recipient' mod='sendtoafriend'} :</p>
|
<p class="intro_form">{l s='Recipient' mod='sendtoafriend'} :</p>
|
||||||
<p class="text">
|
<p class="text">
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ class shopimporter extends ImportModule
|
|||||||
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency')))
|
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency')))
|
||||||
{
|
{
|
||||||
$moduleName = Tools::getValue('moduleName');
|
$moduleName = Tools::getValue('moduleName');
|
||||||
if (Validate::isModuleName($moduleName) && Validate::file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
|
if (Validate::isModuleName($moduleName) && file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
|
||||||
{
|
{
|
||||||
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');
|
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');
|
||||||
$importModule = new $moduleName();
|
$importModule = new $moduleName();
|
||||||
@@ -959,7 +959,15 @@ class shopimporter extends ImportModule
|
|||||||
c.id_parent = c2.`id_category_'.bqSQL($moduleName).'`
|
c.id_parent = c2.`id_category_'.bqSQL($moduleName).'`
|
||||||
SET
|
SET
|
||||||
c.id_parent = c2.id_category
|
c.id_parent = c2.id_category
|
||||||
WHERE c.`id_category_'.bqSQL($moduleName).'` != 0');
|
WHERE c.`id_category_'.bqSQL($moduleName).'` != 0
|
||||||
|
AND c.`id_parent` != 0');
|
||||||
|
|
||||||
|
// get PS home category
|
||||||
|
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'category c
|
||||||
|
SET c.id_parent = '.Configuration::get('PS_HOME_CATEGORY').'
|
||||||
|
WHERE c.`id_category_'.bqSQL($moduleName).'` != 0
|
||||||
|
AND c.`id_parent` = 0');
|
||||||
|
|
||||||
$category = new Category();
|
$category = new Category();
|
||||||
$cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT'));
|
$cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||||
foreach($cats as $cat)
|
foreach($cats as $cat)
|
||||||
|
|||||||
@@ -621,7 +621,7 @@ function updateCartSummary(json)
|
|||||||
initial_price_text = '<span style="text-decoration:line-through;">' + initial_price + '</span><br />';
|
initial_price_text = '<span style="text-decoration:line-through;">' + initial_price + '</span><br />';
|
||||||
|
|
||||||
var key_for_blockcart = product_list[i].id_product + '_' + product_list[i].id_product_attribute + '_' + product_list[i].id_address_delivery;
|
var key_for_blockcart = product_list[i].id_product + '_' + product_list[i].id_product_attribute + '_' + product_list[i].id_address_delivery;
|
||||||
var key_for_blockcart_nocustom = product_list[i].id_product + '_' + product_list[i].id_product_attribute + '_' + ((product_list[i].quantity_without_customization != product_list[i].quantity)? 'nocustom' : '0') + '_' + product_list[i].id_address_delivery;
|
var key_for_blockcart_nocustom = product_list[i].id_product + '_' + product_list[i].id_product_attribute + '_' + ((product_list[i].id_customization && product_list[i].quantity_without_customization != product_list[i].quantity)? 'nocustom' : '0') + '_' + product_list[i].id_address_delivery;
|
||||||
|
|
||||||
if (priceDisplayMethod !== 0)
|
if (priceDisplayMethod !== 0)
|
||||||
{
|
{
|
||||||
@@ -643,8 +643,10 @@ function updateCartSummary(json)
|
|||||||
if (product_list[i].quantity_without_customization != product_list[i].quantity)
|
if (product_list[i].quantity_without_customization != product_list[i].quantity)
|
||||||
$('#total_product_price_' + key_for_blockcart_nocustom).html(formatCurrency(product_list[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
$('#total_product_price_' + key_for_blockcart_nocustom).html(formatCurrency(product_list[i].total_wt, currencyFormat, currencySign, currencyBlank));
|
||||||
}
|
}
|
||||||
$('input[name=quantity_' + key_for_blockcart_nocustom + ']').val(product_list[i].quantity_without_customization);
|
|
||||||
$('input[name=quantity_' + key_for_blockcart_nocustom + '_hidden]').val(product_list[i].quantity_without_customization);
|
$('input[name=quantity_' + key_for_blockcart_nocustom + ']').val(product_list[i].id_customization? product_list[i].quantity_without_customization : product_list[i].cart_quantity);
|
||||||
|
$('input[name=quantity_' + key_for_blockcart_nocustom + '_hidden]').val(product_list[i].id_customization? product_list[i].quantity_without_customization : product_list[i].cart_quantity);
|
||||||
|
|
||||||
if (typeof(product_list[i].customizationQuantityTotal) !== 'undefined' && product_list[i].customizationQuantityTotal > 0)
|
if (typeof(product_list[i].customizationQuantityTotal) !== 'undefined' && product_list[i].customizationQuantityTotal > 0)
|
||||||
$('#cart_quantity_custom_' + key_for_blockcart).html(product_list[i].customizationQuantityTotal);
|
$('#cart_quantity_custom_' + key_for_blockcart).html(product_list[i].customizationQuantityTotal);
|
||||||
nbrProducts += parseInt(product_list[i].quantity);
|
nbrProducts += parseInt(product_list[i].quantity);
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ var productcomments_controller_url = '{$productcomments_controller_url}';
|
|||||||
var confirm_report_message = "{l s='Are you sure you want report this comment?' mod='productcomments'}";
|
var confirm_report_message = "{l s='Are you sure you want report this comment?' mod='productcomments'}";
|
||||||
var secure_key = "{$secure_key}";
|
var secure_key = "{$secure_key}";
|
||||||
var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
||||||
|
var productcomment_added = '{l s='Your comment has been added !' mod='productcomments'}';
|
||||||
|
var productcomment_title = '{l s='New comment' mod='productcomments'}';
|
||||||
|
var productcomment_ok = '{l s='OK' mod='productcomments'}';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="idTab5">
|
<div id="idTab5">
|
||||||
@@ -89,7 +92,7 @@ var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
|
|||||||
<!-- Fancybox -->
|
<!-- Fancybox -->
|
||||||
<div style="display: none;">
|
<div style="display: none;">
|
||||||
<div id="new_comment_form">
|
<div id="new_comment_form">
|
||||||
<form action="#">
|
<form id="id_new_comment_form" action="#">
|
||||||
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
|
||||||
<div class="product clearfix">
|
<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'}" />
|
<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'}" />
|
||||||
|
|||||||
@@ -278,7 +278,9 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
|
|||||||
//
|
//
|
||||||
// render cached template
|
// render cached template
|
||||||
//
|
//
|
||||||
$_template->properties['unifunc']($_template);
|
/* PrestaShop related to PSCFV-10040 - http://www.smarty.net/forums/viewtopic.php?p=76467 */
|
||||||
|
if (isset($_template->properties['unifunc']))
|
||||||
|
$_template->properties['unifunc']($_template);
|
||||||
// any unclosed {capture} tags ?
|
// any unclosed {capture} tags ?
|
||||||
if (isset($_template->_capture_stack[0][0])) {
|
if (isset($_template->_capture_stack[0][0])) {
|
||||||
$_template->capture_error();
|
$_template->capture_error();
|
||||||
|
|||||||
Reference in new issue
Block a user