renjii Posted March 22, 2014 Share Posted March 22, 2014 (edited) Hi In Prestashop i used to replaced the following code to reserve the product to display the newly added product on top in featured product. However, i can no longer do this in 1.6 due to the code change in the module. Can code expert help to make this workable on 1.6 again ? //$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));to: $products = array_reverse($products); Thanks Edited March 23, 2014 by renjii (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted March 22, 2014 Share Posted March 22, 2014 It's the same, but inside the _cacheProducts method: HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position'); Link to comment Share on other sites More sharing options...
renjii Posted March 22, 2014 Author Share Posted March 22, 2014 Hi Nemo Thanks for pointing this out but how should I change the code to make it works ? should i change it to $cache_products = array_reverse($cache_products); ? Link to comment Share on other sites More sharing options...
renjii Posted March 23, 2014 Author Share Posted March 23, 2014 (edited) Hi I tried to change to HomeFeatured::$cache_products = array_reverse($category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position')); but it's still not working. am i missing anything there ? Or the code i changed is incorrect. i notice in the live edit is showing the reverse but when in actual site it doesn't reverse ( see the 2 attach picture) am I missing some code ? Thanks Edited March 23, 2014 by renjii (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted March 24, 2014 Share Posted March 24, 2014 Try erasing cache now Link to comment Share on other sites More sharing options...
9muicom Posted April 2, 2014 Share Posted April 2, 2014 (edited) PrestaShop™ 1.6.0.5 Edit : homefeatured.php line : 113 HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'date_upd', 'DESC'); ................... erasing cache http://screencast.com/t/bzgbX92d demo: http://www.9mui.com/ Edited April 2, 2014 by 9muicom (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts