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;
|
||||
return;
|
||||
}
|
||||
|
||||
Cache::clean('getContextualValue_*');
|
||||
$delivery_option_list = $this->getDeliveryOptionList(null, true);
|
||||
|
||||
foreach ($delivery_option_list as $id_address => $options)
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ class GenderCore extends ObjectModel
|
||||
|
||||
public function getImage($use_unknown = false)
|
||||
{
|
||||
if (!file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
|
||||
return ($use_unknown) ? _PS_ADMIN_IMG_.'unknown.gif' : false;
|
||||
if (!isset($this->id) || empty($this->id) || !file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
|
||||
return _THEME_GENDERS_DIR_.'Unknown.jpg';
|
||||
return _THEME_GENDERS_DIR_.$this->id.'.jpg';
|
||||
}
|
||||
}
|
||||
@@ -940,8 +940,8 @@ abstract class ObjectModelCore
|
||||
{
|
||||
global $_FIELDS;
|
||||
|
||||
if (file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
|
||||
include(_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_once(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
|
||||
|
||||
$key = $class.'_'.md5($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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,11 +65,9 @@ class ProductSaleCore
|
||||
{
|
||||
if ($page_number < 0) $page_number = 0;
|
||||
if ($nb_products < 1) $nb_products = 10;
|
||||
|
||||
$final_order_by = $order_by;
|
||||
if (empty($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_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales';
|
||||
if (is_null($order_way) || $order_by == 'sales') $order_way == 'DESC';
|
||||
$groups = FrontController::getCurrentCustomerGroups();
|
||||
$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;
|
||||
|
||||
@@ -280,7 +280,7 @@ class SpecificPriceRuleCore extends ObjectModel
|
||||
$specific_price->id_currency = (int)$rule->id_currency;
|
||||
$specific_price->id_group = (int)$rule->id_group;
|
||||
$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 = ($rule->reduction_type == 'percentage' ? $rule->reduction / 100 : (float)$rule->reduction);
|
||||
$specific_price->from = $rule->from;
|
||||
@@ -288,4 +288,4 @@ class SpecificPriceRuleCore extends ObjectModel
|
||||
|
||||
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)
|
||||
{
|
||||
if (is_null($smarty))
|
||||
if ($smarty === null)
|
||||
$smarty = Context::getContext()->smarty;
|
||||
|
||||
|
||||
if ($smarty === null)
|
||||
return;
|
||||
|
||||
if (!$tpl && $cache_id === null && $compile_id === null)
|
||||
return $smarty->clearAllCache();
|
||||
|
||||
@@ -2456,4 +2459,3 @@ function cmpPriceDesc($a, $b)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user