diff --git a/admin-dev/tabs/AdminOrders.php b/admin-dev/tabs/AdminOrders.php index 126478268..e51c81ac1 100644 --- a/admin-dev/tabs/AdminOrders.php +++ b/admin-dev/tabs/AdminOrders.php @@ -787,7 +787,7 @@ class AdminOrders extends AdminTab .($product['product_supplier_reference'] ? $this->l('Ref Supplier:').' '.$product['product_supplier_reference'] : '') .' '.Tools::displayPrice($product_price, $currency, false).' - '.((int)($product['product_quantity']) - $product['customizationQuantityTotal']).' + 1 ? 'style="font-weight:700;font-size:1.1em;color:red"' : '').'>'.(int)$quantity.' '.($order->hasBeenPaid() ? ''.(int)($product['product_quantity_refunded']).'' : '').' '.($order->hasBeenDelivered() ? ''.(int)($product['product_quantity_return']).'' : '').' '.$productObj->getStock($product['product_attribute_id']).' diff --git a/admin-dev/tabs/AdminPPreferences.php b/admin-dev/tabs/AdminPPreferences.php index e13944dd9..d21ec1f88 100644 --- a/admin-dev/tabs/AdminPPreferences.php +++ b/admin-dev/tabs/AdminPPreferences.php @@ -71,6 +71,7 @@ class AdminPPreferences extends AdminPreferences 'PS_PRODUCT_PICTURE_WIDTH' => array('title' => $this->l('Product pictures width:'), 'desc' => $this->l('The maximum width of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_HEIGHT' => array('title' => $this->l('Product pictures height:'), 'desc' => $this->l('The maximum height of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL), 'PS_LEGACY_IMAGES' => array('title' => $this->l('Use the legacy image filesystem:'), 'desc' => $this->l('This should be set to yes unless you successfully moved images in Preferences > Images tab'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), + 'PS_QTY_DISCOUNT_ON_COMBINATION' => array('title' => $this->l('Quantity discounts based on:'), 'desc' => $this->l('The way of calculate quantity discounts'), 'cast' => 'intval', 'show' => true, 'required' => true, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Products'), 1 => $this->l('Combinations'))) ), ), ); diff --git a/admin-dev/tabs/AdminStores.php b/admin-dev/tabs/AdminStores.php index 20a7b3242..02241d6ef 100644 --- a/admin-dev/tabs/AdminStores.php +++ b/admin-dev/tabs/AdminStores.php @@ -54,8 +54,8 @@ class AdminStores extends AdminTab $this->fieldsDisplay = array( 'id_store' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'country' => array('title' => $this->l('Country'), 'width' => 100), - 'state' => array('title' => $this->l('State'), 'width' => 100), + 'country' => array('title' => $this->l('Country'), 'width' => 100, 'filter_key' => 'cl!name'), + 'state' => array('title' => $this->l('State'), 'width' => 100, 'filter_key' => 'st!name'), 'city' => array('title' => $this->l('City'), 'width' => 100), 'postcode' => array('title' => $this->l('Zip code'), 'width' => 50), 'name' => array('title' => $this->l('Name'), 'width' => 120, 'filter_key' => 'a!name'), @@ -115,8 +115,9 @@ class AdminStores extends AdminTab if ((int)($country->contains_states) AND !$id_state) $this->_errors[] = Tools::displayError('An address located in a country containing states must have a state selected.'); - $latitude = (int)(Tools::getValue('latitude')); - $longitude = (int)(Tools::getValue('longitude')); + $latitude = (float)(Tools::getValue('latitude')); + $longitude = (float)(Tools::getValue('longitude')); + if(empty($latitude) OR empty($longitude)) $this->_errors[] = Tools::displayError('Latitude and longitude are required.'); diff --git a/admin-dev/tabs/AdminUpgrade.php b/admin-dev/tabs/AdminUpgrade.php index 11639bc61..2faf89ff8 100755 --- a/admin-dev/tabs/AdminUpgrade.php +++ b/admin-dev/tabs/AdminUpgrade.php @@ -1128,9 +1128,10 @@ class AdminUpgrade extends AdminPreferences { static $apacheModuleList = null; - if (!is_array($apacheModuleList)) + if (!is_array($apacheModuleList) AND function_exists('apache_get_modules')) + { $apacheModuleList = apache_get_modules(); - + } // we need strpos (example can be evasive20 foreach($apacheModuleList as $module) if (strpos($name, $module)!==false) diff --git a/cache/class_index.php b/cache/class_index.php index d413e5f53..4ef7adb63 100644 --- a/cache/class_index.php +++ b/cache/class_index.php @@ -142,6 +142,7 @@ 'ModuleGridEngine' => 'override/classes/ModuleGridEngine.php', 'MySQLCore' => 'classes/MySQL.php', 'MySQL' => 'override/classes/MySQL.php', + 'Notification' => 'classes/Notification.php', 'ObjectModelCore' => 'classes/ObjectModel.php', 'ObjectModel' => 'override/classes/ObjectModel.php', 'OrderCore' => 'classes/Order.php', diff --git a/classes/Cart.php b/classes/Cart.php index 89debb89e..bca4cb5ce 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1151,7 +1151,10 @@ class CartCore extends ObjectModel $tmp = $shipping; if ($shipping <= $tmp) + { $id_carrier = (int)($row['id_carrier']); + $tmp = $shipping; + } } else // by price { @@ -1161,10 +1164,13 @@ class CartCore extends ObjectModel $tmp = $shipping; if ($shipping <= $tmp) + { $id_carrier = (int)($row['id_carrier']); + $tmp = $shipping; } } } + } if (empty($id_carrier)) $id_carrier = Configuration::get('PS_CARRIER_DEFAULT'); diff --git a/classes/Helper.php b/classes/Helper.php index 2af69f792..47ee26dcb 100755 --- a/classes/Helper.php +++ b/classes/Helper.php @@ -78,6 +78,8 @@ class HelperCore $html .= 'var selectedCat = "'.implode(',', $selected_cat).'"'; else $html .= 'var selectedCat = "'.implode(',', array_keys($selected_cat)).'"'; + } else { + $html .= 'var selectedCat = ""'; } $html .= ' var selectedLabel = \''.$trads['selected'].'\'; diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php index 1f580a2c9..b398ed8fb 100644 --- a/classes/Manufacturer.php +++ b/classes/Manufacturer.php @@ -360,14 +360,14 @@ class ManufacturerCore extends ObjectModel $ids = array(); foreach ($id_addresses as $id) $ids[] = (int)$id['id']; - $result1 = (Db::getInstance()->ExecuteS(' + $result1 = (Db::getInstance()->Execute(' UPDATE `'._DB_PREFIX_.'address` SET id_manufacturer = 0 WHERE id_manufacturer = '.(int)$this->id.' AND deleted = 0') !== false); $result2 = true; if (count($ids)) - $result2 = (Db::getInstance()->ExecuteS(' + $result2 = (Db::getInstance()->Execute(' UPDATE `'._DB_PREFIX_.'address` SET id_customer = 0, id_supplier = 0, id_manufacturer = '.(int)$this->id.' WHERE id_address IN('.implode(',', $ids).') diff --git a/classes/Order.php b/classes/Order.php index e6e8618ea..b1af1b1ca 100644 --- a/classes/Order.php +++ b/classes/Order.php @@ -427,7 +427,10 @@ class OrderCore extends ObjectModel if ($this->_taxCalculationMethod == PS_TAX_EXC) $row['product_price'] = ($row['product_price'] - $row['product_price'] * ($row['reduction_percent'] * 0.01)); else - $row['product_price_wt'] = Tools::ps_round(($row['product_price_wt'] - $row['product_price_wt'] * ($row['reduction_percent'] * 0.01)), 2); + { + $reduction = Tools::ps_round($row['product_price_wt'] * ($row['reduction_percent'] * 0.01), 2); + $row['product_price_wt'] = Tools::ps_round(($row['product_price_wt'] - $reduction), 2); + } } if ($row['reduction_amount'] != 0) diff --git a/classes/Product.php b/classes/Product.php index f59b17bcc..341004117 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -249,7 +249,7 @@ class ProductCore extends ObjectModel 'cache_has_attachments' => 'isBool' ); protected $fieldsRequiredLang = array('link_rewrite', 'name'); - /* Description short is limited to 400 chars (but can be configured in Preferences Tab), but without html, so it can't be generic */ + /* Description short is limited to 800 chars (but can be configured in Preferences Tab), but without html, so it can't be generic */ protected $fieldsSizeLang = array('meta_description' => 255, 'meta_keywords' => 255, 'meta_title' => 128, 'link_rewrite' => 128, 'name' => 128, 'available_now' => 255, 'available_later' => 255); protected $fieldsValidateLang = array( @@ -550,14 +550,14 @@ class ProductCore extends ObjectModel { $limit = (int)Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT'); if ($limit <= 0) - $limit = 400; + $limit = 800; if (!is_array($this->description_short)) $this->description_short = array(); foreach ($this->description_short as $k => $value) if (Tools::strlen(strip_tags($value)) > $limit) { - if ($die) die (Tools::displayError().' ('.get_class($this).'->description: length > '.$limit.' for language '.$k.')'); - return $errorReturn ? get_class($this).'->'.Tools::displayError('description: length >').' '.$limit.' '.Tools::displayError('for language').' '.$k : false; + if ($die) die (Tools::displayError().' ('.get_class($this).'->description_short: length > '.$limit.' for language '.$k.')'); + return $errorReturn ? get_class($this).'->'.Tools::displayError('description_short: length >').' '.$limit.' '.Tools::displayError('for language').' '.$k : false; } return parent::validateFieldsLang($die, $errorReturn); } @@ -1676,13 +1676,26 @@ class ProductCore extends ObjectModel $cart_quantity = 0; if ((int)($id_cart)) { - if (!isset(self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)]) OR self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)] != (int)($quantity)) - self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + $condition = ''; + $cache_name = (int)($id_cart).'_'.(int)($id_product); + + if(Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION')) + { + $cache_name = (int)($id_cart).'_'.(int)($id_product).'_'.(int)($id_product_attribute); + $condition = ' AND `id_product_attribute` = '.(int)($id_product_attribute); + } + + if (!isset(self::$_cart_quantity[$cache_name]) OR self::$_cart_quantity[$cache_name] != (int)($quantity)) + { + self::$_cart_quantity[$cache_name] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT SUM(`quantity`) FROM `'._DB_PREFIX_.'cart_product` - WHERE `id_product` = '.(int)($id_product).' AND `id_cart` = '.(int)($id_cart) + WHERE `id_product` = '.(int)($id_product).' + AND `id_cart` = '.(int)($id_cart).' '.$condition ); - $cart_quantity = self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)]; + + $cart_quantity = self::$_cart_quantity[$cache_name]; + } } $quantity = ($id_cart AND $cart_quantity) ? $cart_quantity : $quantity; $id_currency = (int)(Validate::isLoadedObject($context->currency) ? $context->currency->id : Configuration::get('PS_CURRENCY_DEFAULT')); @@ -3402,10 +3415,10 @@ class ProductCore extends ObjectModel */ public function setCoverWs($id_image) { - Db::getInstance()->ExecuteS('UPDATE `'._DB_PREFIX_.'image` + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'image` SET `cover` = 0 WHERE `id_product` = '.(int)($this->id).' '); - Db::getInstance()->ExecuteS('UPDATE `'._DB_PREFIX_.'image` + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'image` SET `cover` = 1 WHERE `id_product` = '.(int)($this->id).' AND `id_image` = '.(int)$id_image); return true; } diff --git a/classes/ProductDownload.php b/classes/ProductDownload.php index ab743b0e8..c5e303386 100644 --- a/classes/ProductDownload.php +++ b/classes/ProductDownload.php @@ -94,7 +94,8 @@ class ProductDownloadCore extends ObjectModel public function delete($deleteFile=false) { if ($deleteFile) - $this->deleteFile(); + return $this->deleteFile(); + return true; } public function getFields() diff --git a/classes/SpecificPrice.php b/classes/SpecificPrice.php index e47c89d87..aa4ea6814 100644 --- a/classes/SpecificPrice.php +++ b/classes/SpecificPrice.php @@ -138,7 +138,7 @@ class SpecificPriceCore extends ObjectModel AND (`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`) ) - ORDER BY `score` DESC, `from_quantity` DESC'); + ORDER BY `from_quantity` DESC, `score` DESC, `from_quantity` DESC'); } return self::$_specificPriceCache[$key]; } @@ -192,19 +192,20 @@ class SpecificPriceCore extends ObjectModel AND (`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`) ) - ORDER BY `score` DESC, `from_quantity` DESC + ORDER BY `from_quantity` DESC, `score` DESC '); $targeted_prices = array(); - $max_score = NULL; + $last_quantity = NULL; foreach($res as $specific_price) { - if (!isset($max_score)) - $max_score = $specific_price['score']; - else if ($max_score != $specific_price['score']) + if (!isset($last_quantity)) + $last_quantity = $specific_price['from_quantity']; + else if ($last_quantity == $specific_price['from_quantity']) break; + $last_quantity = $specific_price['from_quantity']; if ($specific_price['from_quantity'] > 1) $targeted_prices[] = $specific_price; } diff --git a/classes/Tools.php b/classes/Tools.php index 4c1829755..98e0e1b89 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1162,15 +1162,19 @@ class ToolsCore return self::$file_exists_cache[$filename]; } - public static function file_get_contents($url, $useIncludePath = false, $streamContext = NULL) + public static function file_get_contents($url, $useIncludePath = false, $streamContext = NULL, $curlTimeOut = 5) { + if ($streamContext == NULL) + $streamContext = stream_context_create(array('http' => array('timeout' => 5))); + if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) - return file_get_contents($url, $useIncludePath, $streamContext); - else if (function_exists('curl_init')) + return @file_get_contents($url, $useIncludePath, $streamContext); + elseif (function_exists('curl_init') && in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) { $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $curlTimeOut); $content = curl_exec($curl); curl_close($curl); return $content; @@ -1182,11 +1186,7 @@ class ToolsCore public static function simplexml_load_file($url, $class_name = null) { if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) - return simplexml_load_file($url, $class_name); - elseif (function_exists('curl_init')) - { return simplexml_load_string(Tools::file_get_contents($url), $class_name); - } else return false; } diff --git a/classes/Validate.php b/classes/Validate.php index 899a3084b..d88b973c7 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -366,7 +366,7 @@ class ValidateCore */ public static function isCleanHtml($html) { - $jsEvent = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave'; + $jsEvent = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror'; return (!preg_match('/<[ \t\n]*script/i', $html) && !preg_match('/lang; } + /** get the http_accept_language isocode (if exists), + * and use it to find the corresponding prestashop id_lang + * otherwise, return 0. + * @return int id_lang to use + */ private function getIdByHAL(){ - if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $FirstHAL = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); @@ -86,14 +88,16 @@ class LanguageManager } else return 0; - } + /** set lang property with param $_GET['language'] if present, + * or by $_SERVER['HTTP_ACCEPT_LANGUAGE'] otherwise + */ private function setLanguage() { - if( isset($_GET['language']) AND Validate::isInt($_GET['language'])) - $id_lang = (int)($_GET['language']); - if (!isset($id_lang)) + if ( !empty($_GET['language'])) + $id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0; + if (empty($id_lang)) $id_lang = ($this->getIdByHAL()); $this->lang = $this->xml_file->lang[(int)($id_lang)]; } @@ -102,4 +106,4 @@ class LanguageManager { return ($this->lang == NULL) ? false : dirname(__FILE__).$this->lang['trad_file']; } -} \ No newline at end of file +} diff --git a/install-dev/classes/ToolsInstall.php b/install-dev/classes/ToolsInstall.php index 7117e6dc7..7a2154f6d 100644 --- a/install-dev/classes/ToolsInstall.php +++ b/install-dev/classes/ToolsInstall.php @@ -40,28 +40,26 @@ class ToolsInstall { // Don't include theses files if classes are already defined if (!class_exists('Validate', false)) - include_once(INSTALL_PATH.'/../classes/Validate.php'); + require_once(INSTALL_PATH.'/../classes/Validate.php'); if (!class_exists('Db', false)) - include_once(INSTALL_PATH.'/../classes/Db.php'); + require_once(INSTALL_PATH.'/../classes/Db.php'); if (!class_exists('MySQL', false)) - include_once(INSTALL_PATH.'/../classes/MySQL.php'); + require_once(INSTALL_PATH.'/../classes/MySQL.php'); if($posted) { // Check POST data... $data_check = array( - !isset($_GET['server']) OR empty($_GET['server']), - !Validate::isMailName($_GET['server']), - !isset($_GET['type']) OR empty($_GET['type']), - !Validate::isMailName($_GET['type']), - !isset($_GET['name']) OR empty($_GET['name']), - !Validate::isMailName($_GET['name']), - !isset($_GET['login']) OR empty($_GET['login']), - !Validate::isMailName($_GET['login']), - !isset($_GET['password']) + !isset($_GET['server']) OR empty($_GET['server']) OR !Validate::isUrl($_GET['server']), + !isset($_GET['engine']) OR empty($_GET['engine']) OR !Validate::isMySQLEngine($_GET['engine']), + !isset($_GET['name']) OR empty($_GET['name']) OR !Validate::isUnixName($_GET['name']), + !isset($_GET['login']) OR empty($_GET['login']) OR !Validate::isUnixName($_GET['login']), + !isset($_GET['password']), + !isset($_GET['tablePrefix']) OR !Validate::isTablePrefix($_GET['tablePrefix']), ); + foreach ($data_check AS $data) if ($data) return 8; @@ -100,9 +98,9 @@ class ToolsInstall public static function sendMail($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort = 25, $smtpEncryption) { - include(INSTALL_PATH.'/../tools/swift/Swift.php'); - include(INSTALL_PATH.'/../tools/swift/Swift/Connection/SMTP.php'); - include(INSTALL_PATH.'/../tools/swift/Swift/Connection/NativeMail.php'); + require_once(INSTALL_PATH.'/../tools/swift/Swift.php'); + require_once(INSTALL_PATH.'/../tools/swift/Swift/Connection/SMTP.php'); + require_once(INSTALL_PATH.'/../tools/swift/Swift/Connection/NativeMail.php'); $swift = NULL; $result = NULL; diff --git a/install-dev/controller.js b/install-dev/controller.js index 202b998ef..a5bf754c6 100644 --- a/install-dev/controller.js +++ b/install-dev/controller.js @@ -367,12 +367,12 @@ function verifyDbAccess () url: "model.php", data: "method=checkDB" - +"&type=MySQL" +"&server="+ $("#dbServer").val() +"&login="+ $("#dbLogin").val() +"&password="+encodeURIComponent($("#dbPassword").val()) +"&engine="+$("#dbEngine option:selected").val() - +"&name="+ $("#dbName").val(), + + "&name=" + $("#dbName").val() + + "&tablePrefix=" + $("#db_prefix").val(), success: function(ret) { ret = ret.getElementsByTagName('action')[0]; diff --git a/install-dev/index.php b/install-dev/index.php index 380636796..db6363f03 100644 --- a/install-dev/index.php +++ b/install-dev/index.php @@ -54,9 +54,9 @@ if (version_compare(phpversion(), '5.0.0', '<')) die; } -require(dirname(__FILE__).'/../config/autoload.php'); -include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); -include_once(INSTALL_PATH.'/classes/GetVersionFromDb.php'); +require_once(dirname(__FILE__).'/../config/autoload.php'); +require_once(INSTALL_PATH.'/classes/ToolsInstall.php'); +require_once(INSTALL_PATH.'/classes/GetVersionFromDb.php'); /* Prevent from bad URI parsing when using index.php */ $requestUri = str_replace('index.php', '', $_SERVER['REQUEST_URI']); @@ -71,7 +71,7 @@ $tooOld = true; $installOfOldVersion = false; if (file_exists(INSTALL_PATH.'/../config/settings.inc.php')) { - include(INSTALL_PATH.'/../config/settings.inc.php'); + require_once(INSTALL_PATH.'/../config/settings.inc.php'); $oldversion =_PS_VERSION_; // fix : complete version number if there is not all 4 numbers @@ -92,7 +92,7 @@ if (file_exists(INSTALL_PATH.'/../config/settings.inc.php')) $installOfOldVersion = (version_compare($oldversion, INSTALL_VERSION) == 1); } -include(INSTALL_PATH.'/classes/LanguagesManager.php'); +require_once(INSTALL_PATH.'/classes/LanguagesManager.php'); $lm = new LanguageManager(dirname(__FILE__).'/langs/list.xml'); $_LANG = array(); $_LIST_WORDS = array(); @@ -101,7 +101,7 @@ function lang($txt) { return (isset($_LANG[$txt]) ? $_LANG[$txt] : $txt); } if ($lm->getIncludeTradFilename()) - include_once($lm->getIncludeTradFilename()); + require_once($lm->getIncludeTradFilename()); ?> @@ -173,7 +173,7 @@ if ($lm->getIncludeTradFilename()) txtError[5] = ""; txtError[6] = ""; txtError[7] = ""; - txtError[8] = ""; + txtError[8] = ""; txtError[9] = ""; txtError[10] = ""; txtError[11] = ""; diff --git a/install-dev/langs/de.php b/install-dev/langs/de.php index 0889c330e..535de5088 100644 --- a/install-dev/langs/de.php +++ b/install-dev/langs/de.php @@ -283,3 +283,4 @@ $_LANG['In this aim, use our'] = 'Verwenden Sie dazu unseren'; $_LANG['Additional Benefits'] = 'Exklusiv Angebot'; $_LANG['Exclusive offers dedicated to PrestaShop merchants'] = 'Exklusiv Angebot f√ºr die Verk√§ufer PrestaShop'; $_LANG['PHP magic quotes option is off (recommended)'] = 'Die PHP-Option "magic quotes" ist deaktiviert (empfohlen)'; +$_LANG['Other activity...'] = 'Andere activiteit...'; diff --git a/install-dev/langs/es.php b/install-dev/langs/es.php index 36a851621..ec9c800a8 100644 --- a/install-dev/langs/es.php +++ b/install-dev/langs/es.php @@ -283,3 +283,4 @@ $_LANG['In this aim, use our'] = 'En este objetivo, utilice nuestro'; $_LANG['Additional Benefits'] = 'Otros beneficios'; $_LANG['Exclusive offers dedicated to PrestaShop merchants'] = 'Ofertas exclusivas dedicadas a los comerciantes PrestaShop'; $_LANG['PHP magic quotes option is off (recommended)'] = 'La opci√≥n PHP "magic quotes" est√° desactivada (aconsejable)'; +$_LANG['Other activity...'] = 'Otra actividad...'; diff --git a/install-dev/langs/fr.php b/install-dev/langs/fr.php index 0cb62b88f..fcfd28d90 100644 --- a/install-dev/langs/fr.php +++ b/install-dev/langs/fr.php @@ -22,7 +22,7 @@ $_LANG['Configure your database by filling out the following fields:'] = 'Config $_LANG['Congratulation, your online shop is now ready!'] = 'Félicitations, votre boutique est installée !'; $_LANG['Contact us!'] = 'Contactez-nous !'; $_LANG['Create new files and folders allowed'] = 'Création de nouveaux dossiers et fichiers autorisée'; -$_LANG['Data integrity is not valided. Hack attempt?'] = 'L\'intégrité des données n\'est pas validée.'; +$_LANG['Your database connection settings are not valid. Please check your server, name, login and prefix.'] = 'Vos informations de connexion à la base de données ne sont pas valides. Veuillez vérifier le serveur, nom, login et préfixe que vous avez indiqué.'; $_LANG['Database Server is available but database is not found'] = 'Le serveur de bases de données est disponible mais la base de données n\'a pas été trouvée'; $_LANG['Database Server is not found. Please verify the login, password and server fields.'] = 'Le serveur de bases de données n\'a pas été trouvé, merci de vérifier vos identifiants ou le nom du serveur.'; $_LANG['Database configuration'] = 'Configuration de la base de données'; @@ -289,3 +289,4 @@ $_LANG['Additional Benefits'] = 'Avantages exclusifs PrestaShop'; $_LANG['Exclusive offers dedicated to PrestaShop merchants'] = 'Offres réservées aux marchands PrestaShop'; $_LANG['PHP magic quotes option is off (recommended)'] = 'L\'option PHP "magic quotes" est désactivée (recommandé)'; $_LANG['Dom extension loaded'] = 'L\'extension Dom est activée'; +$_LANG['Other activity...'] = 'Autre activité..'; diff --git a/install-dev/langs/it.php b/install-dev/langs/it.php index fcd02f548..7e2cf1832 100644 --- a/install-dev/langs/it.php +++ b/install-dev/langs/it.php @@ -270,3 +270,4 @@ $_LANG['In this aim, use our'] = 'A questo scopo, utilizzare il nostro'; $_LANG['Additional Benefits'] = 'Ulteriori vantaggi'; $_LANG['Exclusive offers dedicated to PrestaShop merchants'] = 'Offerte esclusivo dedicato ai venditori PrestaShop'; $_LANG['PHP magic quotes option is off (recommended)'] = 'Opzione magic quotes PHP è disattivata (consigliato)'; +$_LANG['Other activity...'] = 'Altre attività ...'; diff --git a/install-dev/model.php b/install-dev/model.php index 2c8915f0a..18617d825 100644 --- a/install-dev/model.php +++ b/install-dev/model.php @@ -54,6 +54,7 @@ if ( substr($memory_limit,-1) != 'G' ){ @ini_set('memory_limit','128M'); } +require_once(dirname(__FILE__).'/../config/autoload.php'); /* Redefine REQUEST_URI if empty (on some webservers...) */ if (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] == '') @@ -64,7 +65,7 @@ $_SERVER['REQUEST_URI'] = str_replace('//', '/', $_SERVER['REQUEST_URI']); define('INSTALL_VERSION', '1.5.0.1'); define('PS_INSTALLATION_IN_PROGRESS', true); -include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); +require_once(INSTALL_PATH.'/classes/ToolsInstall.php'); define('SETTINGS_FILE', INSTALL_PATH.'/../config/settings.inc.php'); define('DEFINES_FILE', INSTALL_PATH.'/../config/defines.inc.php'); define('INSTALLER__PS_BASE_URI', substr($_SERVER['REQUEST_URI'], 0, -1 * (strlen($_SERVER['REQUEST_URI']) - strrpos($_SERVER['REQUEST_URI'], '/')) - strlen(substr(dirname($_SERVER['REQUEST_URI']), strrpos(dirname($_SERVER['REQUEST_URI']), '/')+1)))); @@ -85,31 +86,31 @@ if (isset($_GET['method'])) switch ($_GET['method']) { case 'checkConfig' : - include_once('xml/checkConfig.php'); + require_once('xml/checkConfig.php'); break; case 'checkDB' : - include_once('xml/checkDB.php'); + require_once('xml/checkDB.php'); break; case 'createDB' : - include_once('xml/createDB.php'); + require_once('xml/createDB.php'); break; case 'checkMail' : - include_once('xml/checkMail.php'); + require_once('xml/checkMail.php'); break; case 'checkShopInfos' : - include_once('xml/checkShopInfos.php'); + require_once('xml/checkShopInfos.php'); break; case 'doUpgrade' : - include_once('xml/doUpgrade.php'); + require_once('xml/doUpgrade.php'); break; case 'getVersionFromDb' : - include_once('xml/getVersionFromDb.php'); + require_once('xml/getVersionFromDb.php'); break; } } diff --git a/install-dev/php/gridextjs_deprecated.php b/install-dev/php/gridextjs_deprecated.php index 6f83b84c3..82b635efe 100644 --- a/install-dev/php/gridextjs_deprecated.php +++ b/install-dev/php/gridextjs_deprecated.php @@ -25,10 +25,22 @@ * International Registered Trademark & Property of PrestaShop SA */ +/** remove the uncompatible module gridextjs (1.4.0.8 upgrade) + */ function gridextjs_deprecated() { - if (file_exists(dirname(__FILE__).'/../../modules/gridextjs')) - return rename(dirname(__FILE__).'/../../modules/gridextjs', dirname(__FILE__).'/../../modules/gridextjs.deprecated'); + // if exists, use _PS_MODULE_DIR_ or _PS_ROOT_DIR_ + // instead of guessing the modules dir + if (defined('_PS_MODULE_DIR_')) + $gridextjs_path = _PS_MODULE_DIR_ . 'gridextjs'; + else + if (defined('_PS_ROOT_DIR_')) + $gridextjs_path = _PS_ROOT_DIR_ . '/modules/gridextjs'; + else + $gridextjs_path = dirname(__FILE__).'/../../modules/gridextjs'; + + if (file_exists($gridextjs_path)) + return rename($gridextjs_path, str_replace('gridextjs', 'gridextjs.deprecated', $gridextjs_path)); return true; } diff --git a/install-dev/preactivation.php b/install-dev/preactivation.php index bb5a0c12e..25899edee 100644 --- a/install-dev/preactivation.php +++ b/install-dev/preactivation.php @@ -1,5 +1,5 @@ shop = Shop::initialize(); define('_THEME_NAME_', Context::getContext()->shop->getTheme()); diff --git a/install-dev/xml/createDB.php b/install-dev/xml/createDB.php index 4b22c4b05..08b1b5aca 100644 --- a/install-dev/xml/createDB.php +++ b/install-dev/xml/createDB.php @@ -36,29 +36,22 @@ if (file_exists(SETTINGS_FILE)) if (!unlink(SETTINGS_FILE)) die(''."\n"); -include(INSTALL_PATH.'/classes/AddConfToFile.php'); -include(INSTALL_PATH.'/../classes/Validate.php'); -include(INSTALL_PATH.'/../classes/Db.php'); -include(INSTALL_PATH.'/../classes/Tools.php'); +require_once(INSTALL_PATH.'/classes/AddConfToFile.php'); +require_once(INSTALL_PATH.'/../classes/Validate.php'); +require_once(INSTALL_PATH.'/../classes/Db.php'); +require_once(INSTALL_PATH.'/../classes/Tools.php'); global $logger; //check db access include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); -$resultDB = ToolsInstall::checkDB($_GET['server'], $_GET['login'], $_GET['password'], $_GET['name'], true, $_GET['engine']); +$resultDB = ToolsInstall::checkDB($_GET['server'], $_GET['login'], $_GET['password'], $_GET['name'], true); if ($resultDB !== true){ $logger->logError('Invalid database configuration'); die("\n"); } - -// Check POST data... -$data_check = array( - !isset($_GET['mode']) OR ( $_GET['mode'] != "full" AND $_GET['mode'] != "lite"), - !isset($_GET['tablePrefix']) OR !Validate::isMailName($_GET['tablePrefix']) OR !preg_match('/^[a-z0-9_]*$/i', $_GET['tablePrefix']) -); -foreach ($data_check AS $data) - if ($data) +if (!isset($_GET['mode']) OR ($_GET['mode'] != "full" AND $_GET['mode'] != "lite")) die(''."\n"); // Writing data in settings file @@ -67,12 +60,12 @@ $_PS_DIRECTORY_ = trim(str_replace(' ', '%20', INSTALLER__PS_BASE_URI), '/'); $_PS_DIRECTORY_ = ($_PS_DIRECTORY_) ? '/'.$_PS_DIRECTORY_.'/' : '/'; $datas = array( array('_DB_SERVER_', trim($_GET['server'])), - array('_DB_TYPE_', trim($_GET['type'])), + array('_DB_TYPE_', 'MySQL'), array('_DB_NAME_', trim($_GET['name'])), array('_DB_USER_', trim($_GET['login'])), array('_DB_PASSWD_', trim($_GET['password'])), array('_DB_PREFIX_', trim($_GET['tablePrefix'])), - array('_MYSQL_ENGINE_', $_GET['engine']), + array('_MYSQL_ENGINE_', trim($_GET['engine'])), array('_PS_CACHING_SYSTEM_', 'MCached'), array('_PS_CACHE_ENABLED_', '0'), array('_MEDIA_SERVER_1_', ''), @@ -103,8 +96,8 @@ foreach (array(INSTALL_PATH.'/../tools/smarty/cache/', INSTALL_PATH.'/../tools/s if ($confFile->error != false) die(''."\n"); -//load new settings -include(SETTINGS_FILE); +//load new settings, and fatal error if you can't +require_once(SETTINGS_FILE); //----------- //import SQL data diff --git a/install-dev/xml/doUpgrade.php b/install-dev/xml/doUpgrade.php index 6e2758fa3..daf23e70f 100644 --- a/install-dev/xml/doUpgrade.php +++ b/install-dev/xml/doUpgrade.php @@ -241,7 +241,7 @@ if (empty($neededUpgradeFiles)) //refresh conf file -include(INSTALL_PATH.'/classes/AddConfToFile.php'); +require_once(INSTALL_PATH.'/classes/AddConfToFile.php'); $oldLevel = error_reporting(E_ALL); $mysqlEngine = (defined('_MYSQL_ENGINE_') ? _MYSQL_ENGINE_ : 'MyISAM'); $datas = array( diff --git a/install-dev/xml/getVersionFromDb.php b/install-dev/xml/getVersionFromDb.php index 4a88bd723..dce0273f1 100644 --- a/install-dev/xml/getVersionFromDb.php +++ b/install-dev/xml/getVersionFromDb.php @@ -26,9 +26,9 @@ */ require_once(SETTINGS_FILE); -include_once(INSTALL_PATH.'/classes/GetVersionFromDb.php'); +require_once(INSTALL_PATH.'/classes/GetVersionFromDb.php'); -include(INSTALL_PATH.'/classes/LanguagesManager.php'); +require_once(INSTALL_PATH.'/classes/LanguagesManager.php'); $lm = new LanguageManager(INSTALL_PATH.'/langs/list.xml'); $_LANG = array(); $_LIST_WORDS = array(); @@ -82,4 +82,4 @@ if ($psVersionDb && in_array($psVersionDb, $versions)) else { die('' . _PS_VERSION_ . '', '' . $versions[count($versions) - 1] . '', '' . $versions[0] . '')) . '" />'); -} \ No newline at end of file +} diff --git a/localization/vn.xml b/localization/vn.xml index 511150333..500515098 100644 --- a/localization/vn.xml +++ b/localization/vn.xml @@ -1,7 +1,7 @@ - + @@ -21,8 +21,8 @@ - - - + + + diff --git a/modules/blocklayered/blocklayered-ajax-back.php b/modules/blocklayered/blocklayered-ajax-back.php index adaac79e3..352568a68 100644 --- a/modules/blocklayered/blocklayered-ajax-back.php +++ b/modules/blocklayered/blocklayered-ajax-back.php @@ -26,9 +26,14 @@ */ /* Getting cookie or logout */ -include(dirname(__FILE__).'/../../config/config.inc.php'); +/*include(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); -include(dirname(__FILE__).'/blocklayered.php'); +include(dirname(__FILE__).'/blocklayered.php');*/ + +/* Clean categoryBox before use */ +if (isset($_GET['categoryBox']) AND is_array($_GET['categoryBox'])) + foreach ($_GET['categoryBox'] AS &$value) + $value = (int)$value; $blockLayered = new BlockLayered(); echo $blockLayered->ajaxCallBackOffice((isset($_GET['categoryBox']) AND is_array($_GET['categoryBox'])) ? $_GET['categoryBox'] : array(), diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index e03716a58..7fa8d173c 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -52,7 +52,6 @@ class BlockLayered extends Module if ($result = parent::install() AND $this->registerHook('leftColumn') AND $this->registerHook('header') AND $this->registerHook('footer') AND $this->registerHook('categoryAddition') AND $this->registerHook('categoryUpdate') AND $this->registerHook('categoryDeletion')) { - Configuration::updateValue('PS_LAYERED_SHARE', 0); Configuration::updateValue('PS_LAYERED_HIDE_0_VALUES', 0); Configuration::updateValue('PS_LAYERED_SHOW_QTIES', 1); @@ -66,11 +65,8 @@ class BlockLayered extends Module public function uninstall() { /* Delete all configurations */ - Configuration::deleteByName('PS_LAYERED_SHARE'); Configuration::deleteByName('PS_LAYERED_HIDE_0_VALUES'); Configuration::deleteByName('PS_LAYERED_SHOW_QTIES'); - Configuration::deleteByName('PS_LAYERED_BITLY_USERNAME'); - Configuration::deleteByName('PS_LAYERED_BITLY_API_KEY'); return parent::uninstall(); } @@ -165,6 +161,11 @@ class BlockLayered extends Module if (sizeof($_POST['categoryBox'])) { + /* Clean categoryBox before use */ + if (isset($_POST['categoryBox']) AND is_array($_POST['categoryBox'])) + foreach ($_POST['categoryBox'] AS &$value) + $value = (int)$value; + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_category WHERE id_category IN ('.implode(',', $_POST['categoryBox']).')'); $filterValues = array(); @@ -208,20 +209,9 @@ class BlockLayered extends Module } } elseif (Tools::isSubmit('submitLayeredSettings')) - { - if (Tools::getValue('share_url')) - { - if (Tools::getValue('bitly_username') == '') - $errors[] = $this->l('Bit.ly username is empty'); - if (Tools::getValue('bitly_api_key') == '') - $errors[] = $this->l('Bit.ly api_key is empty'); - } - + { if (!sizeof($errors)) { - Configuration::updateValue('PS_LAYERED_BITLY_USERNAME', Tools::getValue('bitly_username')); - Configuration::updateValue('PS_LAYERED_BITLY_API_KEY', Tools::getValue('bitly_api_key')); - Configuration::updateValue('PS_LAYERED_SHARE', Tools::getValue('share_url')); Configuration::updateValue('PS_LAYERED_HIDE_0_VALUES', Tools::getValue('ps_layered_hide_0_values')); Configuration::updateValue('PS_LAYERED_SHOW_QTIES', Tools::getValue('ps_layered_show_qties')); @@ -268,22 +258,6 @@ class BlockLayered extends Module } $html .= ' -

'.$this->l('Layered navigation').'

'.$this->l('Existing filters templates').''; @@ -573,29 +547,8 @@ class BlockLayered extends Module '.$this->l('No').' '.$this->l('No').' - - - '.$this->l('Allow customers to share URLs').' - - - '.$this->l('Yes').' - - '.$this->l('No').' - - + -
-

'.$this->l('To offer your customers short links, create an account on bit.ly, then copy and paste login and API key.').' - '.$this->l('Sign Up').'

- -
- -
- -
- -
-

'; @@ -723,7 +676,7 @@ class BlockLayered extends Module /* Return only the number of products */ $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' - SELECT COUNT(p.`id_product`) AS total + SELECT COUNT(p.`id_product`) total FROM `'._DB_PREFIX_.'product` p WHERE 1 '.$queryFilters); @@ -739,12 +692,12 @@ class BlockLayered extends Module '.Product::sqlStock('p', 0).' LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1) LEFT JOIN '._DB_PREFIX_.'image_lang il ON (i.id_image = il.id_image AND il.id_lang = '.(int)$this->context->language->id.') - LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) + LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) WHERE p.`active` = 1 AND pl.id_lang = '.(int)$this->context->language->id .$queryFilters. ' ORDER BY '.Tools::getProductsOrder('by', Tools::getValue('orderby')).' '.Tools::getProductsOrder('way', Tools::getValue('orderway')). - ' LIMIT '.(((int)(Tools::getValue('p', 1)) - 1) * $n.','.$n); + ' LIMIT '.(((int)(Tools::getValue('p', 1)) - 1) * $n.','.$n); $this->products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); return $this->products; @@ -780,12 +733,12 @@ class BlockLayered extends Module $whereC = rtrim($whereC, 'OR '); $productsSQL = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT p.`id_product`, p.`condition`, p.`id_manufacturer`, p.`weight`, stock.quantity, - (SELECT GROUP_CONCAT(`id_category`) FROM `'._DB_PREFIX_.'category_product` cp WHERE cp.`id_product` = p.`id_product`) as ids_cat, - (SELECT GROUP_CONCAT(`id_feature_value`) FROM `'._DB_PREFIX_.'feature_product` fp WHERE fp.`id_product` = p.`id_product`) as ids_feat, + (SELECT GROUP_CONCAT(`id_category`) FROM `'._DB_PREFIX_.'category_product` cp WHERE cp.`id_product` = p.`id_product`) ids_cat, + (SELECT GROUP_CONCAT(`id_feature_value`) FROM `'._DB_PREFIX_.'feature_product` fp WHERE fp.`id_product` = p.`id_product`) ids_feat, (SELECT GROUP_CONCAT(DISTINCT(pac.`id_attribute`)) FROM `'._DB_PREFIX_.'product_attribute_combination` pac LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.`id_product_attribute` = pac.`id_product_attribute`) - WHERE pa.`id_product` = p.`id_product` ) as ids_attr + WHERE pa.`id_product` = p.`id_product`) ids_attr FROM '._DB_PREFIX_.'product p '.Product::sqlStock('p', 0).' WHERE p.`active` = 1 AND p.`id_product` IN ( SELECT id_product FROM `'._DB_PREFIX_.'category_product` cp WHERE'.$whereC.')', false); @@ -818,7 +771,7 @@ class BlockLayered extends Module /* Get the filters for the current category */ $filters = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM '._DB_PREFIX_.'layered_category WHERE id_category = '.(int)$id_parent.' ORDER BY position ASC'); $filterBlocks = $f = $a = array(); - + foreach ($filters AS $filter) { $filterBlocks[(int)$filter['position']]['type_lite'] = $filter['type']; @@ -878,7 +831,6 @@ class BlockLayered extends Module } } - $weight_unit = Configuration::get('PS_WEIGHT_UNIT'); foreach ($filterBlocks AS &$filterBlock) { if ($filterBlock['type_lite'] == 'category') @@ -1067,7 +1019,7 @@ class BlockLayered extends Module $filterBlock['values'] = array($selectedFilters['weight'][0], $selectedFilters['weight'][1]); else $filterBlock['values'] = array(min($weight), max($weight)); - $filterBlock['unit'] = $weight_unit; + $filterBlock['unit'] = Configuration::get('PS_WEIGHT_UNIT'); } else unset($selectedFilters['weight']); @@ -1085,15 +1037,13 @@ class BlockLayered extends Module $share_url = $this->context->link->getCategoryLink((int)$category->id, $category->link_rewrite[(int)$this->context->language->id], $this->context->language->id).rtrim($params, '&'); $this->context->smarty->assign(array( - 'display_share' => (int)Configuration::get('PS_LAYERED_SHARE'), - 'share_url' => $this->getShortLink($share_url), 'layered_show_qties' => (int)Configuration::get('PS_LAYERED_SHOW_QTIES'), 'id_category_layered' => (int)$id_parent, 'selected_filters' => $selectedFilters, 'n_filters' => (int)$nFilters, 'nbr_filterBlocks' => sizeof($filterBlocks), 'filters' => $filterBlocks)); - + return $this->display(__FILE__, 'blocklayered.tpl'); } @@ -1110,6 +1060,11 @@ class BlockLayered extends Module $categoryBox[] = (int)$id_category; } + /* Clean categoryBox before use */ + if (isset($categoryBox) AND is_array($categoryBox)) + foreach ($categoryBox AS &$value) + $value = (int)$value; + $attributeGroups = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT ag.id_attribute_group, ag.is_color_group, agl.name, COUNT(DISTINCT(a.id_attribute)) n FROM '._DB_PREFIX_.'attribute_group ag @@ -1215,6 +1170,7 @@ class BlockLayered extends Module $selectedFilters = $this->getSelectedFilters(); $products = $this->getProductByFilters($selectedFilters); $products = Product::getProductsProperties($this->context->language->id, $products); + $nbProducts = $this->nbr_products; $range = 2; /* how many pages around page selected */ @@ -1250,7 +1206,6 @@ class BlockLayered extends Module $this->context->smarty->assign('comparator_max_item', (int)Configuration::get('PS_COMPARATOR_MAX_ITEM')); $this->context->smarty->assign('products', $products); - /* We are sending an array in jSon to the .js controller, it will update both the filters and the products zones */ return Tools::jsonEncode(array( 'filtersBlock' => $this->generateFiltersBlock($selectedFilters), @@ -1473,23 +1428,4 @@ if (!isset($doneCategories[(int)$id_category]['p'])) } return $products; } - - private function getShortLink($share_url) { - - $return = ''; - if (extension_loaded('curl')) - { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "http://api.bitly.com/v3/shorten"); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_HTTPGET, 1); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, 'login='.Configuration::get('PS_LAYERED_BITLY_USERNAME').'&apiKey='.Configuration::get('PS_LAYERED_BITLY_API_KEY').'&longUrl='.urlencode($share_url).'&format=txt'); - $return = curl_exec($ch); - } - if ($return != 'INVALID_LOGIN' AND $return != 'INVALID_APIKEY' AND extension_loaded('curl')) - return $return; - else - return $share_url; - } } diff --git a/modules/blocklayered/blocklayered.tpl b/modules/blocklayered/blocklayered.tpl index 49cdf9ab5..0efbb6efa 100644 --- a/modules/blocklayered/blocklayered.tpl +++ b/modules/blocklayered/blocklayered.tpl @@ -29,12 +29,6 @@

{l s='Catalog' mod='blocklayered'}

- {if $display_share} -
- {l s='Share your search:' mod='blocklayered'} - -
- {/if}
{if isset($selected_filters) && $n_filters > 0} diff --git a/modules/cashondelivery/cashondelivery.php b/modules/cashondelivery/cashondelivery.php index 1f1415d23..8485f8d96 100644 --- a/modules/cashondelivery/cashondelivery.php +++ b/modules/cashondelivery/cashondelivery.php @@ -34,7 +34,7 @@ class CashOnDelivery extends PaymentModule { $this->name = 'cashondelivery'; $this->tab = 'payments_gateways'; - $this->version = '0.3'; + $this->version = '0.4'; $this->author = 'PrestaShop'; $this->need_instance = 0; @@ -44,6 +44,13 @@ class CashOnDelivery extends PaymentModule $this->displayName = $this->l('Cash on delivery (COD)'); $this->description = $this->l('Accept cash on delivery payments'); + + /* For 1.4.3 and less compatibility */ + $updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT'); + if (!Configuration::get('PS_OS_PAYMENT')) + foreach ($updateConfig as $u) + if (!Configuration::get($u) && defined('_'.$u.'_')) + Configuration::updateValue($u, constant('_'.$u.'_')); } public function install() diff --git a/modules/ebay/ajax/eBaySyncProduct.php b/modules/ebay/ajax/eBaySyncProduct.php new file mode 100644 index 000000000..4d57d98ee --- /dev/null +++ b/modules/ebay/ajax/eBaySyncProduct.php @@ -0,0 +1,21 @@ +ajaxProductSync(); + + unset($cookie); +} +else + echo 'ERROR'; + diff --git a/modules/ebay/ebay.php b/modules/ebay/ebay.php index e452e0cd5..0f1822757 100755 --- a/modules/ebay/ebay.php +++ b/modules/ebay/ebay.php @@ -59,7 +59,7 @@ class Ebay extends Module { $this->name = 'ebay'; $this->tab = 'market_place'; - $this->version = '1.2.1'; + $this->version = '1.2.2'; $this->author = 'PrestaShop'; parent::__construct (); $this->displayName = $this->l('eBay'); @@ -541,8 +541,10 @@ class Ebay extends Module // Displaying Information from Prestashop - $stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 2))); $prestashopContent = @file_get_contents('http://www.prestashop.com/partner/modules/ebay.php?version='.$this->version.'&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'®istered='.($alert['registration'] == 1 ? 'no' : 'yes').'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$this->context->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context); + if (!Validate::isCleanHtml($prestashopContent)) + $prestashopContent = ''; // Displaying page $this->_html .= '
@@ -1213,8 +1215,36 @@ class Ebay extends Module $("#button_ebay_sync").attr("value", "'.$this->l('Sync with eBay').'\n(" + nbProducts + " '.$this->l('products').')"); }); }); + + function eBaySync() + { + $(".categorySync").attr("disabled", "true"); + $("#ebay_sync_mode1").attr("disabled", "true"); + $("#ebay_sync_mode2").attr("disabled", "true"); + $("#ebay_sync_option_resync").attr("disabled", "true"); + $("#button_ebay_sync").attr("disabled", "true"); + $("#button_ebay_sync").hide("slow"); + $("#resultSync").html(""); + eBaySyncProduct(); + } + + function eBaySyncProduct() + { + $.ajax({ + url: \''._MODULE_DIR_.'ebay/ajax/eBaySyncProduct.php?token='.Configuration::get('EBAY_SECURITY_TOKEN').'&time='.pSQL(date('Ymdhis').rand()).'\', + success: function(data) + { + tab = data.split("|"); + $("#resultSync").html(tab[1]); + if (tab[0] != "OK") + eBaySyncProduct(); + } + }); + } +
+

'.$this->l('You will now push your products on eBay.').' '.$this->l('Reminder,').' '.$this->l('you will not have to pay any fees if you have a shop on eBay.').'

@@ -1269,7 +1299,10 @@ class Ebay extends Module $(document).ready(function() { $("#catSync").show("slow"); $("#ebay_sync_mode2").attr("checked", true); - }); + '; + if (Tools::getValue('section') == 'sync') + $html .= 'eBaySync();'; + $html .= '}); '; } @@ -1293,16 +1326,14 @@ class Ebay extends Module // Update Sync Option Configuration::updateValue('EBAY_SYNC_OPTION_RESYNC', (Tools::getValue('ebay_sync_option_resync') == 1 ? 1 : 0)); + // Empty error result + Configuration::updateValue('EBAY_SYNC_LAST_PRODUCT', 0); + @unlink('../modules/ebay/ajax/_ebaySyncError.log.php'); + if ($_POST['ebay_sync_mode'] == 'A') { // Update Sync Mod Configuration::updateValue('EBAY_SYNC_MODE', 'A'); - - // Retrieve product list for eBay (which have matched categories) - $productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE `quantity` > 0 AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0)'); - - // Send each product on eBay - $this->_syncProducts($productsList); } else { @@ -1313,13 +1344,102 @@ class Ebay extends Module Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_category_configuration', array('sync' => 0), 'UPDATE', ''); foreach ($_POST['category'] as $id_category) Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_category_configuration', array('sync' => 1), 'UPDATE', '`id_category` = '.(int)$id_category); - $productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE `quantity` > 0 AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1)'); - - // Send each product on eBay - $this->_syncProducts($productsList); } } + public function ajaxProductSync() + { + // Take the next product + $where = ''; + if ((int)Configuration::get('EBAY_SYNC_LAST_PRODUCT') > 0) + $where = 'AND `id_product` > '.(int)Configuration::get('EBAY_SYNC_LAST_PRODUCT'); + + + if (Configuration::get('EBAY_SYNC_MODE') == 'A') + { + // Retrieve total nb products for eBay (which have matched categories) + $nbProductsTotal = Db::getInstance()->getValue(' + SELECT COUNT(`id_product`) + FROM `'._DB_PREFIX_.'product` + WHERE `quantity` > 0 AND `active` = 1 + AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0)'); + + // Retrieve products list for eBay (which have matched categories) + $productsList = Db::getInstance()->ExecuteS(' + SELECT `id_product` FROM `'._DB_PREFIX_.'product` + WHERE `quantity` > 0 AND `active` = 1 + AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0) + AND `id_product` NOT IN (SELECT `id_product` FROM `'._DB_PREFIX_.'ebay_product`) + '.$where.' + ORDER BY `id_product` + LIMIT 1'); + + // How Many Product Less ? + $nbProductsLess = Db::getInstance()->getValue(' + SELECT COUNT(`id_product`) FROM `'._DB_PREFIX_.'product` + WHERE `quantity` > 0 AND `active` = 1 + AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0) + AND `id_product` NOT IN (SELECT `id_product` FROM `'._DB_PREFIX_.'ebay_product`) + '.$where); + } + else + { + // Retrieve total nb products for eBay (which have matched categories) + $nbProductsTotal = Db::getInstance()->getValue(' + SELECT COUNT(`id_product`) + FROM `'._DB_PREFIX_.'product` + WHERE `quantity` > 0 AND `active` = 1 + AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1)'); + + // Retrieve products list for eBay (which have matched categories) + $productsList = Db::getInstance()->ExecuteS(' + SELECT `id_product` FROM `'._DB_PREFIX_.'product` + WHERE `quantity` > 0 AND `active` = 1 + AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1) + AND `id_product` NOT IN (SELECT `id_product` FROM `'._DB_PREFIX_.'ebay_product`) + '.$where.' + ORDER BY `id_product` + LIMIT 1'); + + // How Many Product Less ? + $nbProductsLess = Db::getInstance()->getValue(' + SELECT COUNT(`id_product`) FROM `'._DB_PREFIX_.'product` + WHERE `quantity` > 0 AND `active` = 1 + AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1) + AND `id_product` NOT IN (SELECT `id_product` FROM `'._DB_PREFIX_.'ebay_product`) + '.$where); + } + + // Send each product on eBay + if (count($productsList) >= 1) + { + // Save the last product + Configuration::updateValue('EBAY_SYNC_LAST_PRODUCT', (int)$productsList[0]['id_product']); + + // Sync product + $this->_syncProducts($productsList); + + echo 'KO|

Produits : '.($nbProductsTotal - $nbProductsLess + 1).' / '.$nbProductsTotal.'

'; + } + else + { + echo 'OK|'.$this->displayConfirmation($this->l('Settings updated').' ('.$this->l('Option').' '.Configuration::get('EBAY_SYNC_MODE').' : '.($nbProductsTotal - $nbProductsLess).' / '.$nbProductsTotal.' '.$this->l('product(s) sync with eBay').')'); + if (file_exists('_ebaySyncError.log.php')) + { + global $tab_error; + include('_ebaySyncError.log.php'); + foreach ($tab_error as $error) + { + $productsDetails = '
'.$this->l('Product(s) concerned').' :'; + foreach ($error['products'] as $product) + $productsDetails .= '
- '.$product; + echo $this->displayError($error['msg'].'
'.$productsDetails); + } + echo ''; + @unlink('_ebaySyncError.log.php'); + } + } + } private function _syncProducts($productsList) { @@ -1332,6 +1452,13 @@ class Ebay extends Module $ebay = new eBayRequest(); $categoryDefaultCache = array(); + // Get errors back + if (file_exists('_ebaySyncError.log.php')) + { + global $tab_error; + include('_ebaySyncError.log.php'); + } + // Up the time limit @set_time_limit(3600); @@ -1656,19 +1783,10 @@ class Ebay extends Module $count++; } } - if ($count_success > 0) - $this->_html .= $this->displayConfirmation($this->l('Settings updated').' ('.$this->l('Option').' '.Configuration::get('EBAY_SYNC_MODE').' : '.$count_success.'/'.$count.' '.$this->l('product(s) sync with eBay').')'); + if ($count_error > 0) - { - foreach ($tab_error as $error) - { - $productsDetails = '
'.$this->l('Product(s) concerned').' :'; - foreach ($error['products'] as $product) - $productsDetails .= '
- '.$product; - $this->_html .= $this->displayError($error['msg'].'
'.$productsDetails); + file_put_contents('_ebaySyncError.log.php', ''); } - } - } /******************************************************************/ diff --git a/modules/ebay/loading-small.gif b/modules/ebay/loading-small.gif new file mode 100644 index 000000000..e552f291b Binary files /dev/null and b/modules/ebay/loading-small.gif differ diff --git a/modules/hipay/hipay.php b/modules/hipay/hipay.php index 375a83402..12a68eea3 100644 --- a/modules/hipay/hipay.php +++ b/modules/hipay/hipay.php @@ -93,7 +93,7 @@ class Hipay extends PaymentModule Configuration::deleteByName('HIPAY_AZ_'.$rowValues['id_zone']); Configuration::deleteByName('HIPAY_AZ_ALL_'.$rowValues['id_zone']); } - Db::getInstance()->ExecuteS('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE `id_module` = '.(int)$this->id); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE `id_module` = '.(int)$this->id); return true; } @@ -308,7 +308,7 @@ class Hipay extends PaymentModule Configuration::deleteByName('HIPAY_AZ_'.$rowValues['id_zone']); Configuration::deleteByName('HIPAY_AZ_ALL_'.$rowValues['id_zone']); } - Db::getInstance()->ExecuteS('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE `id_module` = '.(int)$this->id); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE `id_module` = '.(int)$this->id); return (true); } @@ -328,7 +328,7 @@ class Hipay extends PaymentModule Configuration::updateValue('HIPAY_AZ_'.$id, 'ko'); } } - Db::getInstance()->ExecuteS('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE `id_module` = '.(int)$this->id); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE `id_module` = '.(int)$this->id); // Add the new configuration zones foreach ($_POST as $key => $val) @@ -339,7 +339,7 @@ class Hipay extends PaymentModule $request = 'SELECT id_country FROM '._DB_PREFIX_.'country WHERE '; $results = Db::getInstance()->ExecuteS($request.$this->getRequestZones('id_zone')); foreach ($results as $rowValues) - Db::getInstance()->ExecuteS('INSERT INTO '._DB_PREFIX_.'module_country VALUE('.(int)$this->id.', '.(int)$rowValues['id_country'].')'); + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'module_country VALUE('.(int)$this->id.', '.(int)$rowValues['id_country'].')'); } elseif (Tools::isSubmit('submitHipay')) diff --git a/modules/mailalerts/product.tpl b/modules/mailalerts/product.tpl index a816403d4..fea6c5798 100644 --- a/modules/mailalerts/product.tpl +++ b/modules/mailalerts/product.tpl @@ -28,7 +28,7 @@ oosHookJsCodeFunctions.push('oosHookJsCodeMailAlert'); function clearText() { - if ($('#oos_customer_email').val() == '{l s='your@email.com' mod='mailalerts'}') + if ($('#oos_customer_email').val() == '{/literal}{l s='your@email.com' mod='mailalerts'}{literal}') $('#oos_customer_email').val(''); } diff --git a/modules/mondialrelay/classes/MRCreateTickets.php b/modules/mondialrelay/classes/MRCreateTickets.php index 1d8488669..0c21a41f0 100755 --- a/modules/mondialrelay/classes/MRCreateTickets.php +++ b/modules/mondialrelay/classes/MRCreateTickets.php @@ -272,11 +272,14 @@ class MRCreateTickets implements IMondialRelayWSMethod */ private function _setRequestDefaultValue() { + $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); $this->_fields['list']['Expe_Langage']['value'] = Configuration::get('MR_LANGUAGE'); + var_dump(Configuration::get('MR_LANGUAGE')); $this->_fields['list']['Expe_Ad1']['value'] = Configuration::get('PS_MR_SHOP_NAME'); $this->_fields['list']['Expe_Ad3']['value'] = Configuration::get('PS_SHOP_ADDR1'); - $this->_fields['list']['Expe_Ad4']['value'] = Configuration::get('PS_SHOP_ADDR2'); + // Deleted, cause to many failed for the process + // $this->_fields['list']['Expe_Ad4']['value'] = Configuration::get('PS_SHOP_ADDR2'); $this->_fields['list']['Expe_Ville']['value'] = Configuration::get('PS_SHOP_CITY'); $this->_fields['list']['Expe_CP']['value'] = Configuration::get('PS_SHOP_CODE'); $this->_fields['list']['Expe_CP']['params']['id_country'] = Configuration::get('PS_COUNTRY_DEFAULT'); @@ -286,7 +289,7 @@ class MRCreateTickets implements IMondialRelayWSMethod else $this->_fields['list']['Expe_Pays']['value'] = substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2); - $this->_fields['list']['Expe_Tel1']['value'] = Configuration::get('PS_SHOP_PHONE'); + $this->_fields['list']['Expe_Tel1']['value'] = str_replace(array('.', ' ', '-'), '', Configuration::get('PS_SHOP_PHONE')); $this->_fields['list']['Expe_Mail']['value'] = Configuration::get('PS_SHOP_EMAIL'); $this->_fields['list']['NbColis']['value'] = 1; $this->_fields['list']['CRT_Valeur']['value'] = 0; @@ -373,7 +376,11 @@ class MRCreateTickets implements IMondialRelayWSMethod foreach($rootCase['list'] as $paramName => &$valueDetailed) if ($paramName != 'Texte' && $paramName != 'Security') { - $valueDetailed['value'] = strtoupper(MRTools::replaceAccentedCharacters($valueDetailed['value'])); + // Mac server make an empty string instead of a cleaned string + // TODO : test on windows and linux server + $cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']); + $valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']); + // Call a pointer function if exist to do different test if (isset($valueDetailed['methodValidation']) && method_exists('MRTools', $valueDetailed['methodValidation']) && @@ -420,10 +427,13 @@ class MRCreateTickets implements IMondialRelayWSMethod $order->update(); $templateVars = array('{followup}' => $trackingURL); + $orderState = (Configuration::get('PS_OS_SHIPPING')) ? + Configuration::get('PS_OS_SHIPPING') : + _PS_OS_SHIPPING_; $history = new OrderHistory(); $history->id_order = (int)($params['NDossier']); - $history->changeIdOrderState(Configuration::get('PS_OS_SHIPPING'), (int)($params['NDossier'])); + $history->changeIdOrderState($orderState, (int)($params['NDossier'])); $history->id_employee = (int)Context::getContext()->employee->id; $history->addWithemail(true, $templateVars); diff --git a/modules/mondialrelay/mondialrelay.js b/modules/mondialrelay/mondialrelay.js index a7d20d7ab..742cfdb5a 100755 --- a/modules/mondialrelay/mondialrelay.js +++ b/modules/mondialrelay/mondialrelay.js @@ -460,7 +460,7 @@ function PS_MRHandleSelectedRelayPoint() $(this).children('a').text(PS_MRTranslationList['Select']); }); // Make the Selection - $(this).text(PS_MRTranslationList['Selected']); + $(this).html(PS_MRTranslationList['Selected']); $(this).parent().attr('class', 'PS_MRFloatRelayPointSelected'); // Get the info about the relay point (relayPoint_RelayPointNumber_IdCarrier) @@ -775,7 +775,7 @@ $(document).ready(function() }); $('#PS_MRDisplayPersonalizedOptions').click(function() { - $('#PS_MRPersonalizedFields').toggle('fast'); + $('#PS_MRAdvancedSettings').toggle('fast'); }); }); diff --git a/modules/mondialrelay/mondialrelay.php b/modules/mondialrelay/mondialrelay.php index c8d081aa6..f7112d4cc 100755 --- a/modules/mondialrelay/mondialrelay.php +++ b/modules/mondialrelay/mondialrelay.php @@ -161,7 +161,7 @@ class MondialRelay extends Module else { // Reactive transport if database wasn't remove at the last uninstall - Db::getInstance()->ExecuteS(' + Db::getInstance()->Execute(' UPDATE `'._DB_PREFIX_.'carrier` c, `'._DB_PREFIX_.'mr_method` m SET `deleted` = 0 WHERE c.id_carrier = m.id_carrier'); @@ -368,7 +368,8 @@ class MondialRelay extends Module self::$modulePath = _PS_MODULE_DIR_. 'mondialrelay/'; self::$MRToken = sha1('mr'._COOKIE_KEY_.'mrAgain'); - $protocol = (Configuration::get('PS_SSL_ENABLED') || Tools::usingSecureMode()) ? 'https://' : 'http://'; + $protocol = (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) + && strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://'; $endURL = __PS_BASE_URI__.'/modules/mondialrelay/'; @@ -647,16 +648,13 @@ class MondialRelay extends Module '.$this->l('To create a Mondial Relay carrier'). ' - '.$this->l('Enter and save your Mondial Relay account settings').'
- - '.$this->l('Create a Carrier').'
+ - '.$this->l('Create a Carrier using the form "add a carrier" below').'
- '.$this->l('Define a price for your carrier on').' '.$this->l('The Carrier page').'
- '.$this->l('To generate labels, you must have a valid and registered address of your store on your'). ' '.$this->l('contact page').'
-

- '.$this->l('URL Cron Task:').' '.Tools::getHttpHost(true, true)._MODULE_DIR_.$this->name.'/cron.php?secure_key='.Configuration::get('MONDIAL_RELAY_SECURE_KEY'). - '


'. @@ -666,7 +664,7 @@ class MondialRelay extends Module $this->settingsstateorderForm(). '
'. - $this->personalizeFormFields(). + $this->advancedSettings(). '
'. $this->addMethodForm(). @@ -893,8 +891,33 @@ class MondialRelay extends Module return $output; } + /* + ** Display advanced settings form + */ + public function advancedSettings() + { + $form = ''; + + $form .= ' +
+ + '.$this->l('Advanced Settings'). ' - + '.$this->l('Click to display / hide the options').' '. + ' +
+

+ '.$this->l('URL Cron Task:').' '.Tools::getHttpHost(true, true) + ._MODULE_DIR_.$this->name.'/cron.php?secure_key='. + Configuration::get('MONDIAL_RELAY_SECURE_KEY'). + '

+
+
'; + return $form; + } + /* ** Form to allow personalization fields sent for MondialRelay + ** Not used anymore but still present if needed */ public function personalizeFormFields() { diff --git a/modules/mondialrelay/style.css b/modules/mondialrelay/style.css index 92d54d911..cd72e769c 100755 --- a/modules/mondialrelay/style.css +++ b/modules/mondialrelay/style.css @@ -281,7 +281,7 @@ tr.PS_MRSelectedCarrier > td display: block; width: 60px; height: 20px; - padding: 5px 20px 0px 25px; + padding: 6px 20px 0px 25px; text-decoration: none; margin-top: 8px; color:#333333; diff --git a/modules/productscategory/productscategory.php b/modules/productscategory/productscategory.php index 63a177099..13f2c872a 100644 --- a/modules/productscategory/productscategory.php +++ b/modules/productscategory/productscategory.php @@ -138,9 +138,9 @@ class productsCategory extends Module if ($categoryProduct['id_product'] != $idProduct) { if ($taxes == 0 OR $taxes == 2) - $categoryProducts[$key]['displayed_price'] = Product::getPriceStatic((int)$categoryProduct['id_product'], true, NULL); + $categoryProducts[$key]['displayed_price'] = Product::getPriceStatic((int)$categoryProduct['id_product'], true, NULL, 2); elseif ($taxes == 1) - $categoryProducts[$key]['displayed_price'] = Product::getPriceStatic((int)$categoryProduct['id_product'], false, NULL); + $categoryProducts[$key]['displayed_price'] = Product::getPriceStatic((int)$categoryProduct['id_product'], false, NULL, 2); } // Get positions diff --git a/modules/referralprogram/referralprogram.php b/modules/referralprogram/referralprogram.php index b368cc85c..f10c97114 100644 --- a/modules/referralprogram/referralprogram.php +++ b/modules/referralprogram/referralprogram.php @@ -279,7 +279,7 @@ class ReferralProgram extends Module

'; $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); - $languages = Language::getLanguages(false); + $languages = Language::getLanguages(true); foreach ($languages AS $language) $this->_html .= ' @@ -489,7 +489,8 @@ class ReferralProgram extends Module } $html = ' -

'.$this->l('Referral program').'

+
 
+

'.$this->l('Referral program').' ('.count($friends).')

'.(isset($sponsor) ? $this->l('Customer\'s sponsor:').' '.$sponsor->firstname.' '.$sponsor->lastname.'' : $this->l('No one has sponsored this customer.')).'

'; if ($friends AND sizeof($friends)) diff --git a/themes/prestashop/pagination.tpl b/themes/prestashop/pagination.tpl index 99b69c9e2..c45923c53 100644 --- a/themes/prestashop/pagination.tpl +++ b/themes/prestashop/pagination.tpl @@ -99,4 +99,4 @@ {/if}
-{/if} +{/if} \ No newline at end of file diff --git a/themes/prestashop/product-list.tpl b/themes/prestashop/product-list.tpl index 66d9eb406..51dc57479 100644 --- a/themes/prestashop/product-list.tpl +++ b/themes/prestashop/product-list.tpl @@ -64,4 +64,4 @@ {/foreach} -{/if} +{/if} \ No newline at end of file