diff --git a/classes/ProductSale.php b/classes/ProductSale.php index bd9046fad..45b4f9469 100644 --- a/classes/ProductSale.php +++ b/classes/ProductSale.php @@ -68,7 +68,7 @@ class ProductSaleCore $final_order_by = $order_by; if (empty($order_by) || $order_by == 'position' || $order_by = 'price') $order_by = 'sales'; - if (empty($order_way)) $order_way = 'DESC'; + if (empty($order_way) || $order_by == 'sales') $order_way = 'DESC'; $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index 959cfdc43..e9b003f07 100755 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -570,7 +570,7 @@ class AdminCartsControllerCore extends AdminController if (isset($summary['gift_products']) && count($summary['gift_products'])) foreach ($summary['gift_products'] as &$product) { - $product['image_link'] = $this->context->link->getImageLink($product['link_rewrite'], $product['id_image'], 'small'); + $product['image_link'] = $this->context->link->getImageLink($product['link_rewrite'], $product['id_image'], 'small_default'); if (!isset($product['attributes_small'])) $product['attributes_small'] = ''; } diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index f3b3fb68d..1aea61201 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -642,12 +642,12 @@ class AdminImportControllerCore extends AdminController if (is_null($separator) || trim($separator) == '') $separator = ','; - do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid)); - $tmp_file = file_put_contents(_PS_UPLOAD_DIR_.$uniqid, $field); - $fd = fopen($temp, 'r'); + do $uniqid_path = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid_path)); + file_put_contents($uniqid_path, $field); + $fd = fopen($uniqid_path, 'r'); $tab = fgetcsv($fd, MAX_LINE_SIZE, $separator); fclose($fd); - unlink($tmp_file); + unlink($uniqid_path); if (empty($tab) || (!is_array($tab))) return array();