Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
+8
-8
@@ -134,6 +134,7 @@ class CartCore extends ObjectModel
|
||||
'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array(
|
||||
'id_product' => array('required' => true, 'xlink_resource' => 'products'),
|
||||
'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'),
|
||||
'id_address_delivery' => array('required' => true, 'xlink_resource' => 'addresses'),
|
||||
'quantity' => array('required' => true),
|
||||
)
|
||||
),
|
||||
@@ -3212,25 +3213,24 @@ class CartCore extends ObjectModel
|
||||
|
||||
public function getWsCartRows()
|
||||
{
|
||||
$query = '
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT id_product, id_product_attribute, quantity
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE id_cart = '.(int)$this->id.'
|
||||
AND id_shop = '.(int)Context::getContext()->shop->id;
|
||||
|
||||
$result = Db::getInstance()->executeS($query);
|
||||
return $result;
|
||||
WHERE id_cart = '.(int)$this->id.' AND id_shop = '.(int)Context::getContext()->shop->id
|
||||
);
|
||||
}
|
||||
|
||||
public function setWsCartRows($values)
|
||||
{
|
||||
if ($this->deleteAssociations())
|
||||
{
|
||||
$query = 'INSERT INTO `'._DB_PREFIX_.'cart_product`(`id_cart`, `id_product`, `id_product_attribute`, `quantity`, `date_add`, `id_shop`) VALUES ';
|
||||
$query = 'INSERT INTO `'._DB_PREFIX_.'cart_product`(`id_cart`, `id_product`, `id_product_attribute`, `id_address_delivery`, `quantity`, `date_add`, `id_shop`) VALUES ';
|
||||
|
||||
foreach ($values as $value)
|
||||
$query .= '('.(int)$this->id.', '.(int)$value['id_product'].', '.
|
||||
(isset($value['id_product_attribute']) ? (int)$value['id_product_attribute'] : 'NULL').', '.(int)$value['quantity'].', NOW(), '.(int)Context::getContext()->shop->id.'),';
|
||||
(isset($value['id_product_attribute']) ? (int)$value['id_product_attribute'] : 'NULL').', '.
|
||||
(isset($value['id_address_delivery']) ? (int)$value['id_address_delivery'] : 0).', '.
|
||||
(int)$value['quantity'].', NOW(), '.(int)Context::getContext()->shop->id.'),';
|
||||
|
||||
Db::getInstance()->execute(rtrim($query, ','));
|
||||
}
|
||||
|
||||
@@ -407,6 +407,7 @@ class ImageManagerCore
|
||||
case 'jpeg':
|
||||
default:
|
||||
$quality = (Configuration::get('PS_JPEG_QUALITY') === false ? 90 : Configuration::get('PS_JPEG_QUALITY'));
|
||||
imageinterlace($resource,1); /// make it PROGRESSIVE
|
||||
$success = imagejpeg($resource, $filename, (int)$quality);
|
||||
break;
|
||||
}
|
||||
|
||||
+10
-2
@@ -224,7 +224,7 @@ class MediaCore
|
||||
$url_data = parse_url($css_uri);
|
||||
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
|
||||
// check if css files exists
|
||||
if (!@filemtime($file_uri))
|
||||
if (!@filemtime($file_uri) && !array_key_exists('host', $url_data))
|
||||
return false;
|
||||
|
||||
if (Context::getContext()->controller->controller_type == 'admin')
|
||||
@@ -386,6 +386,7 @@ class MediaCore
|
||||
{
|
||||
//inits
|
||||
$css_files_by_media = array();
|
||||
$external_css_files = array();
|
||||
$compressed_css_files = array();
|
||||
$compressed_css_files_not_found = array();
|
||||
$compressed_css_files_infos = array();
|
||||
@@ -400,6 +401,13 @@ class MediaCore
|
||||
$infos = array();
|
||||
$infos['uri'] = $filename;
|
||||
$url_data = parse_url($filename);
|
||||
|
||||
if(array_key_exists('host', $url_data))
|
||||
{
|
||||
$external_css_files[$filename] = $media;
|
||||
continue;
|
||||
}
|
||||
|
||||
$infos['path'] = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, '/', $url_data['path']);
|
||||
$css_files_by_media[$media]['files'][] = $infos;
|
||||
if (!array_key_exists('date', $css_files_by_media[$media]))
|
||||
@@ -461,7 +469,7 @@ class MediaCore
|
||||
$url = str_replace(_PS_THEME_DIR_, _THEMES_DIR_._THEME_NAME_.'/', $filename);
|
||||
$css_files[$protocol_link.Tools::getMediaServer($url).$url] = $media;
|
||||
}
|
||||
return $css_files;
|
||||
return array_merge($external_css_files, $css_files);
|
||||
}
|
||||
|
||||
public static function getBackTrackLimit()
|
||||
|
||||
@@ -67,7 +67,7 @@ class ProductSaleCore
|
||||
if ($nb_products < 1) $nb_products = 10;
|
||||
$final_order_by = $order_by;
|
||||
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';
|
||||
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;
|
||||
|
||||
@@ -381,6 +381,39 @@ class AdminControllerCore extends Controller
|
||||
break;
|
||||
}
|
||||
$this->toolbar_title = $bread_extended;
|
||||
|
||||
if (Tools::isSubmit('submitFilter'))
|
||||
{
|
||||
$filter = '';
|
||||
foreach ($this->fields_list AS $field => $t)
|
||||
{
|
||||
if ($val = Tools::getValue($this->table.'Filter_'.$field))
|
||||
{
|
||||
if(!is_array($val) && !empty($val))
|
||||
$filter .= ($filter ? ', ' : $this->l(' filter by ')).$t['title'].' : ';
|
||||
|
||||
if (isset($t['type']) && $t['type'] == 'bool')
|
||||
$filter .= ((bool)$val) ? $this->l('yes') : $this->l('no');
|
||||
elseif(is_string($val))
|
||||
$filter .= $val;
|
||||
elseif(is_array($val))
|
||||
{
|
||||
$tmp = '';
|
||||
foreach($val as $v)
|
||||
if(is_string($v) && !empty($v))
|
||||
$tmp .= ' - '.$v;
|
||||
if(Tools::strlen($tmp))
|
||||
{
|
||||
$tmp = ltrim($tmp, ' - ');
|
||||
$filter .= ($filter ? ', ' : $this->l(' filter by ')).$t['title'].' : ';
|
||||
$filter .= $tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($filter)
|
||||
$this->toolbar_title[] = $filter;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,8 +68,8 @@ class ModuleFrontControllerCore extends FrontController
|
||||
*/
|
||||
public function getTemplatePath()
|
||||
{
|
||||
if (file_exists(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/front/'.$template))
|
||||
return _PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/front/'.$template;
|
||||
if (file_exists(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/front/'.$this->template))
|
||||
return _PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/front/'.$this->template;
|
||||
return _PS_MODULE_DIR_.$this->module->name.'/views/templates/front/';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user