diff --git a/admin-dev/ajaxfilemanager/ajax_file_upload.php b/admin-dev/ajaxfilemanager/ajax_file_upload.php index b21a39c13..c942991ed 100755 --- a/admin-dev/ajaxfilemanager/ajax_file_upload.php +++ b/admin-dev/ajaxfilemanager/ajax_file_upload.php @@ -22,26 +22,18 @@ $upload->setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS)); if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD) - { $error = SYS_DISABLED; - } elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder'])) - { $error = ERR_FOLDER_PATH_NOT_ALLOWED; - }else if(!$upload->isFileUploaded('file')) - { + elseif (!$upload->isFileUploaded('file')) $error = ERR_FILE_NOT_UPLOADED; - }else if(!$upload->moveUploadedFile($_GET['folder'])) - { - $error = ERR_FILE_MOVE_FAILED; - } - elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS))) - { + elseif (!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS))) $error = ERR_FILE_TYPE_NOT_ALLOWED; - }elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE)) - { + elseif (defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE)) $error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE)); - }else + elseif (!$upload->moveUploadedFile($_GET['folder'])) + $error = ERR_FILE_MOVE_FAILED; + else { include_once(CLASS_FILE); $path = $upload->getFilePath(); diff --git a/admin-dev/ajaxfilemanager/ajax_get_file_listing.php b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php index c72110344..bb85caada 100755 --- a/admin-dev/ajaxfilemanager/ajax_get_file_listing.php +++ b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php @@ -24,7 +24,8 @@ if(!empty($_GET['search'])) { include_once(CLASS_SEARCH); - + if (!preg_match('/^'.Tools::pRegexp(realpath(dirname(__FILE__).'/'.$_GET['search_folder']), '/').'/i', _PS_ROOT_DIR_.'/img/cms')) + exit; $search = new Search($_GET['search_folder']); $search->addSearchKeyword('recursive', @$_GET['search_recursively']); $search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']); diff --git a/admin-dev/ajaxfilemanager/inc/config.base.php b/admin-dev/ajaxfilemanager/inc/config.base.php index 28155f21e..5b57feed0 100755 --- a/admin-dev/ajaxfilemanager/inc/config.base.php +++ b/admin-dev/ajaxfilemanager/inc/config.base.php @@ -78,9 +78,9 @@ define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste - define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png');// // + define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png');// // //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// - define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png'); + define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,jpeg,jpeg,png'); //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // define('CONFIG_UPLOAD_INVALID_EXTS', ''); diff --git a/admin-dev/ajaxfilemanager/inc/config.php b/admin-dev/ajaxfilemanager/inc/config.php index 2f30ed245..09b4e4200 100755 --- a/admin-dev/ajaxfilemanager/inc/config.php +++ b/admin-dev/ajaxfilemanager/inc/config.php @@ -10,6 +10,9 @@ //FILESYSTEM CONFIG
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php"); + if (_PS_MODE_DEMO_) + die('This functionality has been disabled.'); + define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration if(!isset($_SESSION)) { diff --git a/admin-dev/ajaxfilemanager/inc/config.tinymce.php b/admin-dev/ajaxfilemanager/inc/config.tinymce.php index c406f47e5..9070323a2 100755 --- a/admin-dev/ajaxfilemanager/inc/config.tinymce.php +++ b/admin-dev/ajaxfilemanager/inc/config.tinymce.php @@ -73,9 +73,9 @@ define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste - define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // + define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png,txt'); // //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// - define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); + define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,jpeg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // define('CONFIG_UPLOAD_INVALID_EXTS', ''); diff --git a/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl index 9a0b01041..a9087d5dc 100644 --- a/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl @@ -35,7 +35,7 @@ $.ajax({ type: "POST", url: "index.php", - data: "token={getAdminToken tab='AdminCustomers'}&tab=AdminCustomers&ajax=1&action=updateCustomerNote&id_customer={$customer->id}¬e="+noteContent, + data: "token={getAdminToken tab='AdminCustomers'}&tab=AdminCustomers&ajax=1&action=updateCustomerNote&id_customer={$customer->id}¬e="+encodeURIComponent(noteContent), async : true, success: function(r) { $('#note_feedback').html('').hide(); diff --git a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl index 09a50329f..94c2938df 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl @@ -77,6 +77,7 @@
  • {l s='Sample Addresses file'}
  • {l s='Sample Manufacturers file'}
  • {l s='Sample Suppliers file'}
  • +
  • {l s='Sample Alias file'}
  • {if $PS_ADVANCED_STOCK_MANAGEMENT}
  • {l s='Supply Orders sample file'}
  • {l s='Supply Orders Details sample file'}
  • @@ -203,12 +204,12 @@ }); $("select#entity").change(function(){ - if ($("#entity > option:selected").val() == 7 || $("#entity > option:selected").val() == 8) + if ($("#entity > option:selected").val() == 8 || $("#entity > option:selected").val() == 9) $("label[for=truncate],#truncate").hide(); else $("label[for=truncate],#truncate").show(); - if ($("#entity > option:selected").val() == 8) + if ($("#entity > option:selected").val() == 9) { $(".import_supply_orders_details").show(); $('input[name=multiple_value_separator]').val('|'); @@ -219,14 +220,22 @@ $('input[name=multiple_value_separator]').val('{if isset($multiple_value_separator_selected)}{$multiple_value_separator_selected}{else},{/if}'); } if ($("#entity > option:selected").val() == 1) - $("label[for=match_ref], #match_ref, label[for=regenerate], #regenerate").show(); + $("label[for=match_ref], #match_ref").show(); else - $("label[for=match_ref], #match_ref, label[for=regenerate], #regenerate").hide(); + $("label[for=match_ref], #match_ref").hide(); + if ($("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 0) - $(".import_products_categories, label[for=regenerate], #regenerate").show(); + $(".import_products_categories").show(); else - $(".import_products_categories, label[for=regenerate], #regenerate").hide(); - if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 3 || $("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6) + $(".import_products_categories").hide(); + + if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 || + $("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6) + $("label[for=regenerate], #regenerate").show() + else + $("label[for=regenerate], #regenerate").hide(); + + if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 3 || $("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6 || $("#entity > option:selected").val() == 7) $("label[for=forceIDs], #forceIDs").show(); else $("label[for=forceIDs], #forceIDs").hide(); @@ -260,4 +269,4 @@ }); }; }); - \ No newline at end of file + diff --git a/admin-dev/themes/default/template/controllers/modules/favorites.tpl b/admin-dev/themes/default/template/controllers/modules/favorites.tpl index 13efe0e73..911c3dd28 100755 --- a/admin-dev/themes/default/template/controllers/modules/favorites.tpl +++ b/admin-dev/themes/default/template/controllers/modules/favorites.tpl @@ -59,14 +59,14 @@ {$module->categoryName} diff --git a/admin-dev/themes/default/template/controllers/modules/list.tpl b/admin-dev/themes/default/template/controllers/modules/list.tpl index 8fcd8cabc..62c3cc376 100644 --- a/admin-dev/themes/default/template/controllers/modules/list.tpl +++ b/admin-dev/themes/default/template/controllers/modules/list.tpl @@ -46,7 +46,7 @@ -
    +

    {$module->displayName}{$module->name} {if isset($module->type) && $module->type == 'addonsMustHave'} {l s='Must Have'} diff --git a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl index 044183bf6..b76532dd0 100644 --- a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl +++ b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl @@ -34,6 +34,7 @@

    + {$module->name} {$module->displayName|truncate:36:'…'} {$module->version} {if isset($module->id) && $module->id gt 0 } {if $module->active} diff --git a/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl b/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl index 623e83dde..a10cf1145 100644 --- a/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl +++ b/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl @@ -37,7 +37,7 @@ {l s='Show'} : - + {foreach from=$orderMessages item=orderMessage} {/foreach} diff --git a/admin-dev/themes/default/template/controllers/products/associations.tpl b/admin-dev/themes/default/template/controllers/products/associations.tpl index 71a1d1f53..862d779fa 100644 --- a/admin-dev/themes/default/template/controllers/products/associations.tpl +++ b/admin-dev/themes/default/template/controllers/products/associations.tpl @@ -103,11 +103,11 @@     {l s='Create new manufacturer'} diff --git a/admin-dev/themes/default/template/controllers/products/combinations.tpl b/admin-dev/themes/default/template/controllers/products/combinations.tpl index b6a3e450e..7acfd6d6d 100644 --- a/admin-dev/themes/default/template/controllers/products/combinations.tpl +++ b/admin-dev/themes/default/template/controllers/products/combinations.tpl @@ -85,7 +85,7 @@ {/if} - {if isset($css_files)} - {foreach from=$css_files key=css_uri item=media} - - {/foreach} +{foreach from=$css_files key=css_uri item=media} + +{/foreach} {/if} {if isset($js_files)} - {foreach from=$js_files item=js_uri} - - {/foreach} +{foreach from=$js_files item=js_uri} + +{/foreach} {/if} diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index 8543ee688..8593f7542 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -168,7 +168,7 @@ {/if} >{$option->$input.options.name} {elseif $option == "-"} - + {else} + '; @@ -1524,7 +1524,7 @@ abstract class AdminTabCore if (isset($params['filter_key'])) { echo ''; +

    - '; foreach($curencies AS $curency) $html .= ''; $html .= '
    '; diff --git a/modules/loyalty/LoyaltyModule.php b/modules/loyalty/LoyaltyModule.php index 4a10126fd..cb2c51974 100644 --- a/modules/loyalty/LoyaltyModule.php +++ b/modules/loyalty/LoyaltyModule.php @@ -88,7 +88,9 @@ class LoyaltyModule extends ObjectModel $currentContext = Context::getContext(); $context = clone $currentContext; $context->cart = $cart; - $context->customer = new Customer($context->cart->id_customer); + // if customer is logged we do not recreate it + if(!$context->customer->isLogged(true)) + $context->customer = new Customer($context->cart->id_customer); $context->language = new Language($context->cart->id_lang); $context->shop = new Shop($context->cart->id_shop); $context->currency = new Currency($context->cart->id_currency, null, $context->shop->id); diff --git a/modules/mailalerts/config.xml b/modules/mailalerts/config.xml index d01df2961..98984a992 100755 --- a/modules/mailalerts/config.xml +++ b/modules/mailalerts/config.xml @@ -2,7 +2,7 @@ mailalerts - + diff --git a/modules/mailalerts/mailalerts.php b/modules/mailalerts/mailalerts.php index fb8cd41e4..57ed8cb91 100644 --- a/modules/mailalerts/mailalerts.php +++ b/modules/mailalerts/mailalerts.php @@ -46,7 +46,7 @@ class MailAlerts extends Module { $this->name = 'mailalerts'; $this->tab = 'administration'; - $this->version = '2.5'; + $this->version = '2.7'; $this->author = 'PrestaShop'; $this->need_instance = 0; @@ -257,6 +257,21 @@ class MailAlerts extends Module '; } + public function getAllMessages($id) + { + $messages = Db::getInstance()->executeS(' + SELECT `message` + FROM `'._DB_PREFIX_.'message` + WHERE `id_order` = '.(int)$id.' + ORDER BY `id_message` ASC + '); + $result = array(); + foreach ($messages as $message) { + $result[] = $message['message']; + } + return implode('
    ', $result); + } + public function hookActionValidateOrder($params) { if (!$this->_merchant_order || empty($this->_merchant_mails)) @@ -272,9 +287,9 @@ class MailAlerts extends Module $configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME', 'PS_MAIL_COLOR'), $id_lang, null, $id_shop); $delivery = new Address((int)$order->id_address_delivery); $invoice = new Address((int)$order->id_address_invoice); - $order_date_text = Tools::displayDate($order->date_add, (int)$id_lang); + $order_date_text = Tools::displayDate($order->date_add); $carrier = new Carrier((int)$order->id_carrier); - $message = $order->getFirstMessage(); + $message = $this->getAllMessages($order->id); if (!$message || empty($message)) $message = $this->l('No message'); @@ -378,6 +393,7 @@ class MailAlerts extends Module '{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency), + '{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $currency, false), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency), '{currency}' => $currency->sign, '{message}' => $message @@ -437,16 +453,20 @@ class MailAlerts extends Module public function hookActionUpdateQuantity($params) { $id_product = (int)$params['id_product']; + $product = new Product($id_product); + $product_has_attributes = $product->hasAttributes(); $id_product_attribute = (int)$params['id_product_attribute']; $quantity = (int)$params['quantity']; $context = Context::getContext(); $id_shop = (int)$context->shop->id; $id_lang = (int)$context->language->id; $product = new Product($id_product, true, $id_lang, $id_shop, $context); - $configuration = Configuration::getMultiple(array('MA_LAST_QTIES', 'PS_STOCK_MANAGEMENT', 'PS_SHOP_EMAIL', 'PS_SHOP_NAME'), $id_lang, null, $id_shop); + $configuration = Configuration::getMultiple(array('MA_LAST_QTIES', 'PS_STOCK_MANAGEMENT', 'PS_SHOP_EMAIL', 'PS_SHOP_NAME'), null, null, $id_shop); $ma_last_qties = (int)$configuration['MA_LAST_QTIES']; - - if ($product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)) && $configuration['PS_STOCK_MANAGEMENT']) + + $check_oos = ($product_has_attributes && $id_product_attribute) || (!$product_has_attributes && !$id_product_attribute); + + if ($check_oos && $product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)) && $configuration['PS_STOCK_MANAGEMENT']) { $iso = Language::getIsoById($id_lang); $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang); diff --git a/modules/productcomments/productcomments.php b/modules/productcomments/productcomments.php index 078113f21..9556e3941 100644 --- a/modules/productcomments/productcomments.php +++ b/modules/productcomments/productcomments.php @@ -561,7 +561,7 @@ class ProductComments extends Module
    "> @@ -705,7 +705,7 @@ class ProductComments extends Module $this->context->smarty->assign(array( 'id_product_comment_form' => (int)Tools::getValue('id_product'), - 'product' => new Product((int)Tools::getValue('id_product'), false, $this->context->language->id), + 'product' => $this->context->controller->getProduct(), 'secure_key' => $this->secure_key, 'logged' => (int)$this->context->customer->isLogged(true), 'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'), diff --git a/modules/productscategory/productscategory.php b/modules/productscategory/productscategory.php index fb1f74e36..dd4674de2 100644 --- a/modules/productscategory/productscategory.php +++ b/modules/productscategory/productscategory.php @@ -186,7 +186,7 @@ class productsCategory extends Module { $this->context->controller->addCSS($this->_path.'productscategory.css', 'all'); $this->context->controller->addJS($this->_path.'productscategory.js'); - $this->context->controller->addJqueryPlugin('serialScroll'); + $this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll')); } public function hookAddProduct($params) diff --git a/modules/productscategory/productscategory.tpl b/modules/productscategory/productscategory.tpl index 8b9b9f6cb..409c21e30 100644 --- a/modules/productscategory/productscategory.tpl +++ b/modules/productscategory/productscategory.tpl @@ -23,7 +23,7 @@ * International Registered Trademark & Property of PrestaShop SA *} -{if count($categoryProducts) > 0 && $categoryProducts !== false} +{if isset($categoryProducts) && count($categoryProducts) > 0 && $categoryProducts !== false}

    {$categoryProducts|@count} {l s='other products in the same category:' mod='productscategory'}

    diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php index 7f92c7be9..99915bcd2 100644 --- a/modules/pscleaner/pscleaner.php +++ b/modules/pscleaner/pscleaner.php @@ -151,7 +151,7 @@ class PSCleaner extends Module // Remove inexisting or monolanguage configuration value from configuration_lang $query = 'DELETE FROM `'._DB_PREFIX_.'configuration_lang` WHERE `id_configuration` NOT IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration`) - OR `id_configuration` IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE name IS NOT NULL AND name != "")'; + OR `id_configuration` IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE name IS NULL OR name = "")'; if ($db->Execute($query)) if ($affected_rows = $db->Affected_Rows()) $logs[$query] = $affected_rows; @@ -300,8 +300,6 @@ class PSCleaner extends Module array('stock', 'id_warehouse', 'warehouse', 'id_warehouse'), array('stock', 'id_product', 'product', 'id_product'), array('stock_available', 'id_product', 'product', 'id_product'), - array('stock_available', 'id_shop', 'shop', 'id_shop'), - array('stock_available', 'id_shop_group', 'shop_group', 'id_shop_group'), array('stock_mvt', 'id_stock', 'stock', 'id_stock'), array('tab_module_preference', 'id_employee', 'employee', 'id_employee'), array('tab_module_preference', 'id_tab', 'tab', 'id_tab'), @@ -367,7 +365,13 @@ class PSCleaner extends Module if ($affected_rows = $db->Affected_Rows()) $logs[$query] = $affected_rows; } - + + // stock_available + $query = 'DELETE FROM `'._DB_PREFIX_.'stock_available` WHERE `id_shop` NOT IN (SELECT `id_shop` FROM `'._DB_PREFIX_.'shop`) AND `id_shop_group` NOT IN (SELECT `id_shop_group` FROM `'._DB_PREFIX_.'shop_group`)'; + if ($db->Execute($query)) + if ($affected_rows = $db->Affected_Rows()) + $logs[$query] = $affected_rows; + Category::regenerateEntireNtree(); // @Todo: Remove attachment files, images... diff --git a/modules/referralprogram/controllers/front/program.php b/modules/referralprogram/controllers/front/program.php index 2b4d04dcd..68cf153b1 100755 --- a/modules/referralprogram/controllers/front/program.php +++ b/modules/referralprogram/controllers/front/program.php @@ -183,6 +183,8 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController if ((int)($stats['nb_orders']) >= $orderQuantity) $canSendInvitations = true; + + $discountInPercent = Tools::getValue('discount_type', Configuration::get('REFERRAL_DISCOUNT_TYPE')) == 1; // Smarty display $this->context->smarty->assign(array( @@ -199,7 +201,7 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController 'nbRevive' => $nbRevive, 'subscribeFriends' => ReferralProgramModule::getSponsorFriend((int)($this->context->customer->id), 'subscribed'), 'mails_exists' => (isset($mails_exists) ? $mails_exists : array()), - 'currencySign' => $this->context->currency->sign + 'currencySign' => ($discountInPercent ? '%' : $this->context->currency->sign) )); $this->setTemplate('program.tpl'); } diff --git a/modules/shopimporter/shopimporter.php b/modules/shopimporter/shopimporter.php index b5d67680d..1c43ef6dc 100644 --- a/modules/shopimporter/shopimporter.php +++ b/modules/shopimporter/shopimporter.php @@ -333,7 +333,7 @@ class shopimporter extends ImportModule
    '.$this->l('Category').' : {l s='DNI / NIF / NIE'}

    - {assign var="stateExist" value="false"} - {assign var="postCodeExist" value="false"} + {assign var="stateExist" value=false} + {assign var="postCodeExist" value=false} {foreach from=$ordered_adr_fields item=field_name} {if $field_name eq 'company'}

    @@ -138,7 +138,7 @@ $(function(){ldelim}

    {/if} {if $field_name eq 'postcode'} - {assign var="postCodeExist" value="true"} + {assign var="postCodeExist" value=true}

    @@ -187,7 +187,7 @@ $(function(){ldelim} {/if} {/if} {if $field_name eq 'State:name'} - {assign var="stateExist" value="true"} + {assign var="stateExist" value=true}

    {/if} - {if $stateExist eq "false"} + {if !$stateExist}

    {foreach from=$countries item=v} - + {/foreach}

    - {elseif $field_name eq "State:name"} + {elseif $field_name eq "State:name"} {assign var='stateExist' value=true}

    @@ -319,11 +357,6 @@ $(document).ready(function() {

    - {elseif $field_name eq "phone"} -

    - - -

    {/if} {/foreach} {if $stateExist eq false} @@ -340,19 +373,106 @@ $(document).ready(function() {

    {/if} +

    + + +

    - +

    + + +

    +
    - {$HOOK_CREATE_ACCOUNT_FORM}

    *{l s='Required field'} @@ -532,7 +652,7 @@ $(document).ready(function() {

    @@ -565,13 +685,13 @@ $(document).ready(function() {

    {if isset($one_phone_at_least) && $one_phone_at_least} -

    {l s='You must register at least one phone number.'}

    - {/if} +

    {l s='You must register at least one phone number.'}

    + {/if}

    -

    +

    diff --git a/themes/default/js/order-opc.js b/themes/default/js/order-opc.js index 6480375fb..cbfb44f9c 100644 --- a/themes/default/js/order-opc.js +++ b/themes/default/js/order-opc.js @@ -308,7 +308,7 @@ function saveAddress(type) params += 'address2='+encodeURIComponent($('#address2'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; params += 'postcode='+encodeURIComponent($('#postcode'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; params += 'city='+encodeURIComponent($('#city'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; - params += 'id_country='+encodeURIComponent($('#id_country').val())+'&'; + params += 'id_country='+encodeURIComponent($('#id_country'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; if ($('#id_state'+(type == 'invoice' ? '_invoice' : '')).val()) params += 'id_state='+encodeURIComponent($('#id_state'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; params += 'other='+encodeURIComponent($('#other'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 8e959b9ae..b38b63e38 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -417,14 +417,20 @@ function displayImage(domAAroundImgThumb, no_animation) { if (typeof(no_animation) == 'undefined') no_animation = false; - if (domAAroundImgThumb.attr('href')) + if (domAAroundImgThumb.prop('href')) { - var newSrc = domAAroundImgThumb.attr('href').replace('thickbox', 'large'); - if ($('#bigpic').attr('src') != newSrc) + var new_src = domAAroundImgThumb.prop('href').replace('thickbox', 'large'); + var new_title = domAAroundImgThumb.prop('title'); + var new_href = domAAroundImgThumb.prop('href'); + if ($('#bigpic').prop('src') != new_src) { - $('#bigpic').attr('src', newSrc).load(function() { + $('#bigpic').prop({ + 'src' : new_src, + 'alt' : new_title, + 'title' : new_title + }).load(function(){ if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) - $(this).attr('rel', domAAroundImgThumb.attr('href')); + $(this).prop('rel', new_href); }); } $('#views_block li a').removeClass('shown'); diff --git a/themes/default/js/stores.js b/themes/default/js/stores.js index 38065181e..ffd8e64ba 100644 --- a/themes/default/js/stores.js +++ b/themes/default/js/stores.js @@ -113,7 +113,7 @@ function searchLocationsNear(center) createMarker(latlng, name, address, other, id_store, has_store_picture); bounds.extend(latlng); - $('#stores-table tr:last').after(''+parseInt(i + 1)+''+name+''+(has_store_picture === 1 ? '
    ' : '')+''+address+(phone !== '' ? '

    '+translation_4+' '+phone : '')+''+distance+' '+distance_unit+''); + $('#stores-table tr:last').after(''+parseInt(i + 1)+''+name+''+(has_store_picture === 1 ? '
    ' : '')+''+address+''+distance+' '+distance_unit+''); $('#stores-table').show(); } diff --git a/themes/default/manufacturer.tpl b/themes/default/manufacturer.tpl index e4ae56cc1..bd1e0e3e1 100644 --- a/themes/default/manufacturer.tpl +++ b/themes/default/manufacturer.tpl @@ -33,7 +33,7 @@
    {if !empty($manufacturer->short_description)}

    {$manufacturer->short_description}

    -

    {$manufacturer->description}

    +
    {$manufacturer->description}
    {l s='More'} {else}

    {$manufacturer->description}

    diff --git a/themes/default/mobile/contact-form.tpl b/themes/default/mobile/contact-form.tpl index 6c435356a..01e82c761 100644 --- a/themes/default/mobile/contact-form.tpl +++ b/themes/default/mobile/contact-form.tpl @@ -39,7 +39,7 @@ {/foreach} {else} + + + @@ -424,3 +424,4 @@ {else}

     {l s='You cannot return merchandise with a guest account'}

    {/if} +{/if} \ No newline at end of file diff --git a/themes/default/order-opc-new-account.tpl b/themes/default/order-opc-new-account.tpl index 676ee7b11..4e31a068c 100644 --- a/themes/default/order-opc-new-account.tpl +++ b/themes/default/order-opc-new-account.tpl @@ -74,19 +74,18 @@ {literal} function vat_number() { - if ($('#company').val() != '') + if (($('#company').length) && ($('#company').val() != '')) $('#vat_number_block').show(); else $('#vat_number_block').hide(); } function vat_number_invoice() { - if ($('#company_invoice').val() != '') + if (($('#company_invoice').length) && ($('#company_invoice').val() != '')) $('#vat_number_block_invoice').show(); else $('#vat_number_block_invoice').hide(); } - $(document).ready(function() { $('#company').on('input',function(){ vat_number(); @@ -96,6 +95,10 @@ }); vat_number(); vat_number_invoice(); + {/literal} + $('.id_state option[value={if isset($guestInformations.id_state)}{$guestInformations.id_state|intval}{/if}]').prop('selected', true); + $('.id_state_invoice option[value={if isset($guestInformations.id_state_invoice)}{$guestInformations.id_state_invoice|intval}{/if}]').prop('selected', true); + {literal} }); {/literal} @@ -203,7 +206,7 @@ {elseif $field_name eq "address2"}

    - +

    {elseif $field_name eq "postcode"} {$postCodeExist = true} @@ -279,7 +282,7 @@

    - +

    @@ -289,7 +292,7 @@

    {l s='Invoice address'}

    {foreach from=$inv_all_fields item=field_name} {if $field_name eq "company" && $b2b_enable} -

    +

    @@ -329,7 +332,7 @@ {$postCodeExist = true}

    - +

    {elseif $field_name eq "city"}

    @@ -375,13 +378,13 @@

    {if isset($one_phone_at_least) && $one_phone_at_least} -

    {l s='You must register at least one phone number.'}

    +

    {l s='You must register at least one phone number.'}

    {/if} -

    +

    -

    +

    @@ -402,4 +405,4 @@
    -
    \ No newline at end of file +
    diff --git a/themes/default/product.tpl b/themes/default/product.tpl index dfd32a4ae..8224f865f 100644 --- a/themes/default/product.tpl +++ b/themes/default/product.tpl @@ -183,7 +183,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
    {if $have_image} - {$product->name|escape:'htmlall':'UTF-8'} + {if !empty($cover.legend)}{$cover.legend|escape:'htmlall':'UTF-8'}{else}{$product->name|escape:'htmlall':'UTF-8'}{/if} {l s='Maximize'} {else} @@ -199,16 +199,21 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving {if isset($images) && count($images) > 3}{/if}
      - {if isset($images)} - {foreach from=$images item=image name=thumbnails} + {if isset($images)} + {foreach from=$images item=image name=thumbnails} {assign var=imageIds value="`$product->id`-`$image.id_image`"} + {if !empty($image.legend)} + {assign var=imageTitlte value=$image.legend|escape:'htmlall':'UTF-8'} + {else} + {assign var=imageTitlte value=$product->name|escape:'htmlall':'UTF-8'} + {/if}
    • - - {$image.legend|htmlspecialchars} + + {$imageTitlte}
    • - {/foreach} - {/if} + {/foreach} + {/if}
    {if isset($images) && count($images) > 3}{l s='Next'}{/if}