Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap
Conflicts: admin-dev/themes/default/css/modules.css admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl admin-dev/themes/default/template/controllers/groups/helpers/form/form.tpl admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl admin-dev/themes/default/template/controllers/products/helpers/form/form.tpl admin-dev/themes/default/template/controllers/products/images.tpl admin-dev/themes/default/template/controllers/products/prices.tpl admin-dev/themes/default/template/helpers/form/form.tpl admin-dev/themes/default/template/helpers/list/list_header.tpl classes/Autoload.php classes/Carrier.php classes/Product.php classes/ProductSale.php classes/Tools.php classes/Validate.php classes/tax/TaxRulesTaxManager.php controllers/admin/AdminPPreferencesController.php controllers/admin/AdminPerformanceController.php install-dev/install_version.php js/admin_carrier_wizard.js modules/blockcategories/blockcategories.php modules/blocklayered/blocklayered.php modules/statsequipment/statsequipment.php modules/statsproduct/statsproduct.php modules/watermark/watermark.php themes/default/address.tpl themes/default/authentication.tpl themes/default/category.tpl themes/default/contact-form.tpl themes/default/css/history.css themes/default/header.tpl themes/default/js/cart-summary.js themes/default/js/product.js themes/default/mobile/order-detail.tpl themes/default/modules/blocksearch/blocksearch.tpl themes/default/modules/productcomments/productcomments.tpl themes/default/order-carrier.tpl themes/default/order-detail.tpl themes/default/order-opc-new-account.tpl themes/default/product.tpl
This commit is contained in:
@@ -89,12 +89,15 @@ class AuthControllerCore extends FrontController
|
||||
|
||||
$this->context->smarty->assign('newsletter', 1);
|
||||
|
||||
$back = Tools::getValue('back');
|
||||
$key = Tools::safeOutput(Tools::getValue('key'));
|
||||
if (!empty($key))
|
||||
$back .= (strpos($back, '?') !== false ? '&' : '?').'key='.$key;
|
||||
if (!empty($back))
|
||||
$this->context->smarty->assign('back', Tools::safeOutput(Tools::secureReferrer($back)));
|
||||
if ($back = Tools::safeOutput(Tools::getValue('back')))
|
||||
{
|
||||
$key = Tools::safeOutput(Tools::getValue('key'));
|
||||
if (!empty($key))
|
||||
$back .= (strpos($back, '?') !== false ? '&' : '?').'key='.$key;
|
||||
if ($back == Tools::secureReferrer(Tools::getValue('back')))
|
||||
$this->context->smarty->assign('back', html_entity_decode($back));
|
||||
$this->context->smarty->assign('back', $back);
|
||||
}
|
||||
|
||||
if (Tools::getValue('display_guest_checkout'))
|
||||
{
|
||||
|
||||
@@ -116,6 +116,7 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'category' => $this->category,
|
||||
'description_short' => Tools::truncateString($this->category->description),
|
||||
'products' => (isset($this->cat_products) && $this->cat_products) ? $this->cat_products : null,
|
||||
'id_category' => (int)$this->category->id,
|
||||
'id_category_parent' => (int)$this->category->id_parent,
|
||||
|
||||
@@ -30,12 +30,13 @@ class CmsControllerCore extends FrontController
|
||||
public $assignCase;
|
||||
public $cms;
|
||||
public $cms_category;
|
||||
public $ssl = false;
|
||||
|
||||
public function canonicalRedirection($canonicalURL = '')
|
||||
{
|
||||
if (Tools::getValue('live_edit'))
|
||||
return ;
|
||||
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms)))
|
||||
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms, $this->cms->link_rewrite, $this->ssl)))
|
||||
parent::canonicalRedirection($canonicalURL);
|
||||
else if (Validate::isLoadedObject($this->cms_category) && ($canonicalURL = $this->context->link->getCMSCategoryLink($this->cms_category)))
|
||||
parent::canonicalRedirection($canonicalURL);
|
||||
@@ -47,13 +48,16 @@ class CmsControllerCore extends FrontController
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
if ($id_cms = (int)Tools::getValue('id_cms'))
|
||||
$this->cms = new CMS($id_cms, $this->context->language->id);
|
||||
else if ($id_cms_category = (int)Tools::getValue('id_cms_category'))
|
||||
$this->cms_category = new CMSCategory($id_cms_category, $this->context->language->id);
|
||||
|
||||
if (Configuration::get('PS_SSL_ENABLED') && Tools::getValue('content_only') && Tools::getValue('id_cms') == (int)Configuration::get('PS_CONDITIONS_CMS_ID') && Validate::isLoadedObject($this->cms))
|
||||
$this->ssl = true;
|
||||
|
||||
parent::init();
|
||||
|
||||
$this->canonicalRedirection();
|
||||
|
||||
// assignCase (1 = CMS page, 2 = CMS category)
|
||||
@@ -120,7 +124,7 @@ class CmsControllerCore extends FrontController
|
||||
'category' => $this->cms_category, //for backward compatibility
|
||||
'cms_category' => $this->cms_category,
|
||||
'sub_category' => $this->cms_category->getSubCategories($this->context->language->id),
|
||||
'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)($this->cms_category->id) ),
|
||||
'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)($this->cms_category->id), true, (int)$this->context->shop->id),
|
||||
'path' => ($this->cms_category->id !== 1) ? Tools::getPath($this->cms_category->id, $this->cms_category->name, false, 'CMS') : '',
|
||||
));
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ class ContactControllerCore extends FrontController
|
||||
$cm->message = $message;
|
||||
if (isset($fileAttachment['rename']) && !empty($fileAttachment['rename']) && rename($fileAttachment['tmp_name'], _PS_MODULE_DIR_.'../upload/'.basename($fileAttachment['rename'])))
|
||||
$cm->file_name = $fileAttachment['rename'];
|
||||
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
|
||||
$cm->ip_address = ip2long(Tools::getRemoteAddr());
|
||||
$cm->user_agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
if (!$cm->add())
|
||||
$this->errors[] = Tools::displayError('An error occurred while sending the message.');
|
||||
|
||||
@@ -529,8 +529,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency);
|
||||
if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase)
|
||||
return '<p class="warning">'.sprintf(
|
||||
Tools::displayError('A minimum purchase total of %s is required in order to validate your order.'),
|
||||
Tools::displayPrice($minimalPurchase, $currency)
|
||||
Tools::displayError('A minimum purchase total of %1s (tax excl.) is required in order to validate your order, current purchase total is %2s (tax excl.).'),
|
||||
Tools::displayPrice($minimal_purchase, $currency), Tools::displayPrice($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS), $currency)
|
||||
).'</p>';
|
||||
|
||||
/* Bypass payment step if total is 0 */
|
||||
|
||||
@@ -415,6 +415,17 @@ class ParentOrderControllerCore extends FrontController
|
||||
if (key($customerAddresses) != 0)
|
||||
$customerAddresses = array_values($customerAddresses);
|
||||
|
||||
if (!count($customerAddresses))
|
||||
{
|
||||
$bad_delivery = false;
|
||||
if (($bad_delivery = (bool)!Address::isCountryActiveById((int)$this->context->cart->id_address_delivery)) || (!Address::isCountryActiveById((int)$this->context->cart->id_address_invoice)))
|
||||
{
|
||||
$back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, array('step' => Tools::getValue('step'), 'multi-shipping' => (int)Tools::getValue('multi-shipping')));
|
||||
$params = array('multi-shipping' => (int)Tools::getValue('multi-shipping'), 'id_address' => ($bad_delivery ? (int)$this->context->cart->id_address_delivery : (int)$this->context->cart->id_address_invoice), 'back' => $back_url);
|
||||
Tools::redirect($this->context->link->getPageLink('address', true, (int)$this->context->language->id, $params));
|
||||
}
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'addresses' => $customerAddresses,
|
||||
'formatedAddressFieldsValuesList' => $formatedAddressFieldsValuesList));
|
||||
@@ -465,16 +476,6 @@ class ParentOrderControllerCore extends FrontController
|
||||
$address = new Address($this->context->cart->id_address_delivery);
|
||||
$id_zone = Address::getZoneById($address->id);
|
||||
$bad_delivery = false;
|
||||
if (($bad_delivery = (bool)!Address::isCountryActiveById((int)$this->context->cart->id_address_delivery)) || (!Address::isCountryActiveById((int)$this->context->cart->id_address_invoice)))
|
||||
{
|
||||
if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 1 && Dispatcher::getInstance()->getController() != 'order-opc')
|
||||
{
|
||||
$back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, array('step' => Tools::getValue('step'), 'multi-shipping' => (int)Tools::getValue('multi-shipping')));
|
||||
$params = array('multi-shipping' => (int)Tools::getValue('multi-shipping'), 'id_address' => ($bad_delivery ? (int)$this->context->cart->id_address_delivery : (int)$this->context->cart->id_address_invoice), 'back' => $back_url);
|
||||
Tools::redirect($this->context->link->getPageLink('address', true, (int)$this->context->language->id, $params));
|
||||
}
|
||||
Tools::redirect('index.php?controller=order&step=1');
|
||||
}
|
||||
$carriers = $this->context->cart->simulateCarriersOutput();
|
||||
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
||||
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
||||
@@ -510,7 +511,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
|
||||
// TOS
|
||||
$cms = new CMS(Configuration::get('PS_CONDITIONS_CMS_ID'), $this->context->language->id);
|
||||
$this->link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite);
|
||||
$this->link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, (bool)Configuration::get('PS_SSL_ENABLED'));
|
||||
if (!strpos($this->link_conditions, '?'))
|
||||
$this->link_conditions .= '?content_only=1';
|
||||
else
|
||||
|
||||
@@ -551,7 +551,7 @@ class ProductControllerCore extends FrontController
|
||||
$path = Tools::getPath((int)$this->context->shop->id_category, $this->product->name);
|
||||
$this->context->smarty->assign('path', $path);
|
||||
|
||||
$this->context->smarty->assign('categories', Category::getHomeCategories($this->context->language->id));
|
||||
$this->context->smarty->assign('categories', Category::getHomeCategories($this->context->language->id, true, (int)$this->context->shop->id));
|
||||
$this->context->smarty->assign(array('HOOK_PRODUCT_FOOTER' => Hook::exec('displayFooterProduct', array('product' => $this->product, 'category' => $this->category))));
|
||||
}
|
||||
|
||||
|
||||
@@ -279,6 +279,6 @@ class StoresControllerCore extends FrontController
|
||||
if (!Configuration::get('PS_STORES_SIMPLIFIED'))
|
||||
$this->addJS(_THEME_JS_DIR_.'stores.js');
|
||||
$default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
$this->addJS('http://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));
|
||||
$this->addJS('http'.((Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE')) ? 's' : '').'://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user