premanshu Posted September 18, 2012 Share Posted September 18, 2012 (edited) Upgraded my soon to be live shop from 1.4 to 1.5. Now with everything getting displayed after 4 days of struggle.. New-Products, Best-sellers and price-drop pages are not showing any product. However the modules are able to show the same. It is showing warning as :No new products. This means {if $products} in tpl file is not returning any product. This definitely is a problem in core. Can someone please help on quick fix?? Edited September 18, 2012 by premanshu (see edit history) Link to comment Share on other sites More sharing options...
premanshu Posted September 19, 2012 Author Share Posted September 19, 2012 Hi, Anyone else facing the same issue?? Please help.. Link to comment Share on other sites More sharing options...
fujian Posted September 23, 2012 Share Posted September 23, 2012 i also have this problem. Link to comment Share on other sites More sharing options...
premanshu Posted September 24, 2012 Author Share Posted September 24, 2012 (edited) Here is a quickfix.. I raised a bug PSCFV-4200 but its solution in svn is still not able to resolve the problem. Put $this->orderBy as null in function reference in below files: PricesDropController NewProductsController BestSalesController e.g. 'products' => Product::getPricesDrop($this->context->language->id, (int)$this->p - 1, (int)$this->n, false, $this->orderBy, $this->orderWay) 'products' => Product::getPricesDrop($this->context->language->id, (int)$this->p - 1, (int)$this->n, false, null, $this->orderWay) Edited September 24, 2012 by premanshu (see edit history) Link to comment Share on other sites More sharing options...
louis323 Posted October 3, 2012 Share Posted October 3, 2012 on what file we must chance that ? Link to comment Share on other sites More sharing options...
premanshu Posted October 4, 2012 Author Share Posted October 4, 2012 \controllers\front\PricesDropController.php \controllers\front\NewProductsController.php \controllers\front\BestSalesController.php Link to comment Share on other sites More sharing options...
louis323 Posted October 4, 2012 Share Posted October 4, 2012 Random products how did you make this work ? Link to comment Share on other sites More sharing options...
premanshu Posted October 8, 2012 Author Share Posted October 8, 2012 (edited) I used ORDER BY RAND() in below function: public function getProducts($idcat, $id_lang, $p, $n) { global $cookie; if (empty($idcat)) { return false; } if ($p < 1) $p = 1; $sql = ' SELECT p.*, pl.`link_rewrite`, pl.`name`, i.`id_image`, il.`legend`, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default, (p.`price` * IF(t.`rate`,((100 + (t.`rate`))/100),1)) AS orderprice FROM `'._DB_PREFIX_.'category_product` cp LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int)($id_lang).') LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' AND tr.`id_state` = 0) LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).') WHERE cp.`id_category` NOT IN ('.$idcat.') AND p.`active` = 1 GROUP BY cp.`id_product` ORDER BY RAND() LIMIT '.(((int)($p) - 1) * (int)($n)).','.(int)($n); $result = Db::getInstance()->ExecuteS($sql); if (!$result) return false; /* Modify SQL result */ return Product::getProductsProperties($id_lang, $result); } Edited October 8, 2012 by premanshu (see edit history) Link to comment Share on other sites More sharing options...
premanshu Posted October 17, 2012 Author Share Posted October 17, 2012 (edited) So I finally found the problem here. The above workaround I posted should not be used because it breaks the sorting functionality. It is a bug in PS1.5 that the product list is not displayed if orderby is selected as date_updated i.e. value 3 for PS_PRODUCTS_ORDER_BY in configuration. To make this work.. BO > Preferences > Products > Pagination > Default order by > Manufacturer Edited October 17, 2012 by premanshu (see edit history) Link to comment Share on other sites More sharing options...
THM11 Posted October 18, 2012 Share Posted October 18, 2012 WTF!!! It actually solved my problems regarding this! How in earth does that effect on this - have you created bug report related to this? Anyway thank you! Now I don't have that many not working pages on my FO in production! Thanks! Link to comment Share on other sites More sharing options...
premanshu Posted October 19, 2012 Author Share Posted October 19, 2012 Another update.. Selecting Manufacturer as order will stop displaying manufacturer list. The only option I found working throughout all pages is : BO > Preferences > Products > Pagination > Default order by > Product Name PS developers did not believed my bug so problem will remain in 1.5 till it is noticed by them 1 Link to comment Share on other sites More sharing options...
Xav' Posted October 31, 2012 Share Posted October 31, 2012 Really big problem... Is 1.5.2 solved it ? Link to comment Share on other sites More sharing options...
premanshu Posted October 31, 2012 Author Share Posted October 31, 2012 No.. Not resolved in 1.5.2 as well.. Link to comment Share on other sites More sharing options...
angelac Posted November 9, 2012 Share Posted November 9, 2012 Hi premanshu. Im sorry for my english. I have visited your web and i can see your new products are there. I have the same problem, my new products not displayed. How can you solve it? Thanks Link to comment Share on other sites More sharing options...
premanshu Posted November 12, 2012 Author Share Posted November 12, 2012 Hi angelac, use these settings: BO > Preferences > Products > Pagination > Default order by > Product Name Link to comment Share on other sites More sharing options...
angelac Posted November 12, 2012 Share Posted November 12, 2012 Fantastic!!!!! Thanks !! Link to comment Share on other sites More sharing options...
Recommended Posts