Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
+1
-1
@@ -2293,7 +2293,7 @@ class CartCore extends ObjectModel
|
|||||||
$this->id_carrier = 0;
|
$this->id_carrier = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Cache::clean('getContextualValue_*');
|
||||||
$delivery_option_list = $this->getDeliveryOptionList(null, true);
|
$delivery_option_list = $this->getDeliveryOptionList(null, true);
|
||||||
|
|
||||||
foreach ($delivery_option_list as $id_address => $options)
|
foreach ($delivery_option_list as $id_address => $options)
|
||||||
|
|||||||
+2
-2
@@ -66,8 +66,8 @@ class GenderCore extends ObjectModel
|
|||||||
|
|
||||||
public function getImage($use_unknown = false)
|
public function getImage($use_unknown = false)
|
||||||
{
|
{
|
||||||
if (!file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
|
if (!isset($this->id) || empty($this->id) || !file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
|
||||||
return ($use_unknown) ? _PS_ADMIN_IMG_.'unknown.gif' : false;
|
return _THEME_GENDERS_DIR_.'Unknown.jpg';
|
||||||
return _THEME_GENDERS_DIR_.$this->id.'.jpg';
|
return _THEME_GENDERS_DIR_.$this->id.'.jpg';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -940,8 +940,8 @@ abstract class ObjectModelCore
|
|||||||
{
|
{
|
||||||
global $_FIELDS;
|
global $_FIELDS;
|
||||||
|
|
||||||
if (file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
|
if ($_FIELDS === null && file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
|
||||||
include(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
|
include_once(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
|
||||||
|
|
||||||
$key = $class.'_'.md5($field);
|
$key = $class.'_'.md5($field);
|
||||||
return ((is_array($_FIELDS) && array_key_exists($key, $_FIELDS)) ? ($htmlentities ? htmlentities($_FIELDS[$key], ENT_QUOTES, 'utf-8') : $_FIELDS[$key]) : $field);
|
return ((is_array($_FIELDS) && array_key_exists($key, $_FIELDS)) ? ($htmlentities ? htmlentities($_FIELDS[$key], ENT_QUOTES, 'utf-8') : $_FIELDS[$key]) : $field);
|
||||||
@@ -1596,4 +1596,4 @@ abstract class ObjectModelCore
|
|||||||
{
|
{
|
||||||
$this->update_fields = $fields;
|
$this->update_fields = $fields;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,11 +65,9 @@ class ProductSaleCore
|
|||||||
{
|
{
|
||||||
if ($page_number < 0) $page_number = 0;
|
if ($page_number < 0) $page_number = 0;
|
||||||
if ($nb_products < 1) $nb_products = 10;
|
if ($nb_products < 1) $nb_products = 10;
|
||||||
|
|
||||||
$final_order_by = $order_by;
|
$final_order_by = $order_by;
|
||||||
if (empty($order_by) || $order_by == 'position' || $order_by = 'price') $order_by = 'sales';
|
if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales';
|
||||||
if (empty($order_way) || $order_by == 'sales') $order_way = 'DESC';
|
if (is_null($order_way) || $order_by == 'sales') $order_way == 'DESC';
|
||||||
|
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||||
$interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
|
$interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ class SpecificPriceRuleCore extends ObjectModel
|
|||||||
$specific_price->id_currency = (int)$rule->id_currency;
|
$specific_price->id_currency = (int)$rule->id_currency;
|
||||||
$specific_price->id_group = (int)$rule->id_group;
|
$specific_price->id_group = (int)$rule->id_group;
|
||||||
$specific_price->from_quantity = (int)$rule->from_quantity;
|
$specific_price->from_quantity = (int)$rule->from_quantity;
|
||||||
$specific_price->price = (int)$rule->price;
|
$specific_price->price = (float)$rule->price;
|
||||||
$specific_price->reduction_type = $rule->reduction_type;
|
$specific_price->reduction_type = $rule->reduction_type;
|
||||||
$specific_price->reduction = ($rule->reduction_type == 'percentage' ? $rule->reduction / 100 : (float)$rule->reduction);
|
$specific_price->reduction = ($rule->reduction_type == 'percentage' ? $rule->reduction / 100 : (float)$rule->reduction);
|
||||||
$specific_price->from = $rule->from;
|
$specific_price->from = $rule->from;
|
||||||
@@ -288,4 +288,4 @@ class SpecificPriceRuleCore extends ObjectModel
|
|||||||
|
|
||||||
return $specific_price->add();
|
return $specific_price->add();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
-3
@@ -2121,9 +2121,12 @@ exit;
|
|||||||
*/
|
*/
|
||||||
public static function clearCache($smarty = null, $tpl = false, $cache_id = null, $compile_id = null)
|
public static function clearCache($smarty = null, $tpl = false, $cache_id = null, $compile_id = null)
|
||||||
{
|
{
|
||||||
if (is_null($smarty))
|
if ($smarty === null)
|
||||||
$smarty = Context::getContext()->smarty;
|
$smarty = Context::getContext()->smarty;
|
||||||
|
|
||||||
|
if ($smarty === null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!$tpl && $cache_id === null && $compile_id === null)
|
if (!$tpl && $cache_id === null && $compile_id === null)
|
||||||
return $smarty->clearAllCache();
|
return $smarty->clearAllCache();
|
||||||
|
|
||||||
@@ -2456,4 +2459,3 @@ function cmpPriceDesc($a, $b)
|
|||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -219,22 +219,12 @@ class AdminCmsControllerCore extends AdminController
|
|||||||
/* Close list table and submit button */
|
/* Close list table and submit button */
|
||||||
$this->displayListFooter($token);
|
$this->displayListFooter($token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Modifying initial getList method to display position feature (drag and drop)
|
|
||||||
*/
|
|
||||||
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
|
||||||
{
|
|
||||||
if ($order_by && $this->context->cookie->__get($this->table.'Orderby'))
|
|
||||||
$order_by = $this->context->cookie->__get($this->table.'Orderby');
|
|
||||||
else
|
|
||||||
$order_by = 'position';
|
|
||||||
|
|
||||||
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function postProcess()
|
public function postProcess()
|
||||||
{
|
{
|
||||||
|
if (Tools::isSubmit($this->table.'Orderby') || Tools::isSubmit($this->table.'Orderway'))
|
||||||
|
$this->filter = true;
|
||||||
|
|
||||||
if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
|
if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
|
||||||
{
|
{
|
||||||
$redir = $this->context->link->getCMSLink($cms);
|
$redir = $this->context->link->getCMSLink($cms);
|
||||||
|
|||||||
@@ -391,6 +391,8 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$this->recursiveDeleteOnDisk($tmp_folder);
|
$this->recursiveDeleteOnDisk($tmp_folder);
|
||||||
if ($success && $redirect)
|
if ($success && $redirect)
|
||||||
Tools::redirectAdmin(self::$currentIndex.'&conf=8&anchor=anchor'.ucfirst($folder).'&token='.$this->token);
|
Tools::redirectAdmin(self::$currentIndex.'&conf=8&anchor=anchor'.ucfirst($folder).'&token='.$this->token);
|
||||||
|
|
||||||
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recursiveDeleteOnDisk($dir)
|
protected function recursiveDeleteOnDisk($dir)
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ class AdminPPreferencesControllerCore extends AdminController
|
|||||||
|
|
||||||
public function beforeUpdateOptions()
|
public function beforeUpdateOptions()
|
||||||
{
|
{
|
||||||
if (!Tools::getValue('PS_STOCK_MANAGEMENT'))
|
if (!Tools::getValue('PS_STOCK_MANAGEMENT', true))
|
||||||
{
|
{
|
||||||
$_POST['PS_ORDER_OUT_OF_STOCK'] = 1;
|
$_POST['PS_ORDER_OUT_OF_STOCK'] = 1;
|
||||||
$_POST['PS_DISPLAY_QTIES'] = 0;
|
$_POST['PS_DISPLAY_QTIES'] = 0;
|
||||||
|
|||||||
@@ -257,9 +257,9 @@ class ProductControllerCore extends FrontController
|
|||||||
'HOOK_EXTRA_LEFT' => Hook::exec('displayLeftColumnProduct'),
|
'HOOK_EXTRA_LEFT' => Hook::exec('displayLeftColumnProduct'),
|
||||||
'HOOK_EXTRA_RIGHT' => Hook::exec('displayRightColumnProduct'),
|
'HOOK_EXTRA_RIGHT' => Hook::exec('displayRightColumnProduct'),
|
||||||
'HOOK_PRODUCT_OOS' => Hook::exec('actionProductOutOfStock', array('product' => $this->product)),
|
'HOOK_PRODUCT_OOS' => Hook::exec('actionProductOutOfStock', array('product' => $this->product)),
|
||||||
'HOOK_PRODUCT_ACTIONS' => Hook::exec('displayProductButtons'),
|
'HOOK_PRODUCT_ACTIONS' => Hook::exec('displayProductButtons', array('product' => $this->product)),
|
||||||
'HOOK_PRODUCT_TAB' => Hook::exec('displayProductTab'),
|
'HOOK_PRODUCT_TAB' => Hook::exec('displayProductTab', array('product' => $this->product)),
|
||||||
'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('displayProductTabContent'),
|
'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('displayProductTabContent', array('product' => $this->product)),
|
||||||
'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'),
|
'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'),
|
||||||
'display_ht' => !Tax::excludeTaxeOption(),
|
'display_ht' => !Tax::excludeTaxeOption(),
|
||||||
'currencySign' => $this->context->currency->sign,
|
'currencySign' => $this->context->currency->sign,
|
||||||
|
|||||||
Reference in New Issue
Block a user