Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -637,7 +637,8 @@ class CartRuleCore extends ObjectModel
|
|||||||
FROM `'._DB_PREFIX_.'cart_product` cp
|
FROM `'._DB_PREFIX_.'cart_product` cp
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product
|
LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product
|
||||||
WHERE cp.`id_cart` = '.(int)$context->cart->id.'
|
WHERE cp.`id_cart` = '.(int)$context->cart->id.'
|
||||||
AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')');
|
AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')
|
||||||
|
AND cp.`id_product` <> '.(int)$this->gift_product);
|
||||||
$countMatchingProducts = 0;
|
$countMatchingProducts = 0;
|
||||||
$matchingProductsList = array();
|
$matchingProductsList = array();
|
||||||
foreach ($cartCategories as $cartCategory)
|
foreach ($cartCategories as $cartCategory)
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class AdminAccessControllerCore extends AdminController
|
|||||||
$sql = '
|
$sql = '
|
||||||
UPDATE `'._DB_PREFIX_.'access` a
|
UPDATE `'._DB_PREFIX_.'access` a
|
||||||
SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.'
|
SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.'
|
||||||
WHERE `id_profile` = '.(int)$id_profile.' AND `id_tab` != '.(int)$this->id_tab_access;
|
WHERE `id_profile` = '.(int)$id_profile;
|
||||||
else if ($id_tab == -1 && $perm == 'all')
|
else if ($id_tab == -1 && $perm == 'all')
|
||||||
$sql = '
|
$sql = '
|
||||||
UPDATE `'._DB_PREFIX_.'access` a
|
UPDATE `'._DB_PREFIX_.'access` a
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
$this->fields_form['input'][] = array(
|
$this->fields_form['input'][] = array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => $this->l('Profile:'),
|
'label' => $this->l('Profile Permission:'),
|
||||||
'name' => 'id_profile',
|
'name' => 'id_profile',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'options' => array(
|
'options' => array(
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class AdminImagesControllerCore extends AdminController
|
|||||||
);
|
);
|
||||||
|
|
||||||
// No need to display the old image system if the install has been made later than 2013-03-26
|
// No need to display the old image system if the install has been made later than 2013-03-26
|
||||||
$this->display_move = (defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true;
|
$this->display_move = (!Configuration::get('PS_LEGACY_IMAGES') && defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true;
|
||||||
|
|
||||||
$this->fields_options = array(
|
$this->fields_options = array(
|
||||||
'images' => array(
|
'images' => array(
|
||||||
|
|||||||
@@ -440,6 +440,7 @@ class AdminManufacturersControllerCore extends AdminController
|
|||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => $this->l('Zip Code/Postal Code'),
|
'label' => $this->l('Zip Code/Postal Code'),
|
||||||
'name' => 'postcode',
|
'name' => 'postcode',
|
||||||
|
'required' => true,
|
||||||
'size' => 33,
|
'size' => 33,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ class AdminTrackingControllerCore extends AdminController
|
|||||||
|
|
||||||
public function initContent()
|
public function initContent()
|
||||||
{
|
{
|
||||||
|
if ($id_category = Tools::getValue('id_category') && Tools::getIsset('viewcategory'))
|
||||||
|
Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_category='.(int)$id_category.'&viewcategory');
|
||||||
|
|
||||||
$this->_helper_list = new HelperList();
|
$this->_helper_list = new HelperList();
|
||||||
|
|
||||||
if (!Configuration::get('PS_STOCK_MANAGEMENT'))
|
if (!Configuration::get('PS_STOCK_MANAGEMENT'))
|
||||||
|
|||||||
@@ -47,6 +47,13 @@ class NewProductsControllerCore extends FrontController
|
|||||||
|
|
||||||
$this->productSort();
|
$this->productSort();
|
||||||
|
|
||||||
|
// Override default configuration values: cause the new products page must display latest products first.
|
||||||
|
if (!Tools::getIsset('orderway') || !Tools::getIsset('orderby'))
|
||||||
|
{
|
||||||
|
$this->orderBy = 'date_add';
|
||||||
|
$this->orderWay = 'DESC';
|
||||||
|
}
|
||||||
|
|
||||||
$nbProducts = (int)Product::getNewProducts(
|
$nbProducts = (int)Product::getNewProducts(
|
||||||
$this->context->language->id,
|
$this->context->language->id,
|
||||||
(isset($this->p) ? (int)($this->p) - 1 : null),
|
(isset($this->p) ? (int)($this->p) - 1 : null),
|
||||||
|
|||||||
@@ -52,10 +52,15 @@ function p1540_add_missing_columns()
|
|||||||
}
|
}
|
||||||
|
|
||||||
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');;
|
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');;
|
||||||
if (is_array($key_exists))
|
if (is_array($key_exists) && count($key_exists))
|
||||||
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `product_sqlstock`'))
|
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `product_sqlstock`'))
|
||||||
$errors[] = Db::getInstance()->getMsgError();
|
$errors[] = Db::getInstance()->getMsgError();
|
||||||
|
|
||||||
|
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "id_product_2"');;
|
||||||
|
if (is_array($key_exists) && count($key_exists))
|
||||||
|
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `id_product_2`'))
|
||||||
|
$errors[] = Db::getInstance()->getMsgError();
|
||||||
|
|
||||||
if (count($errors))
|
if (count($errors))
|
||||||
return array('error' => 1, 'msg' => implode(',', $errors)) ;
|
return array('error' => 1, 'msg' => implode(',', $errors)) ;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user