As title mention in featured module if we add product it go at the end but i want to be in opposite way.whenever i add product it should get 1st position instead of last.Please help
Thanks
Aqib
1. EDIT: catalog/controller/module/featured.phpaqibboy2 wrote:As title mention in featured module if we add product it go at the end but i want to be in opposite way.whenever i add product it should get 1st position instead of last.Please help
Thanks
Aqib
2. FIND:
Code: Select all
protected function index($setting) {
Code: Select all
private function array_sort_by_column(&$arr, $col, $dir = SORT_ASC) {
$sort_col = array();
foreach ($arr as $key=> $row) {
$sort_col[$key] = $row[$col];
}
array_multisort($sort_col, $dir, $arr);
}
Code: Select all
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured.tpl')) {
Code: Select all
$this->array_sort_by_column($this->data['products'], 'product_id', SORT_DESC);
Thank You very much for your time and effort i really appreciate it...unfortunately this code not seems to work accurate. i have try in different way that is delete my old products in featured module and add fresh product when i add second product its work fine but when add more product then it will work as random.Qphoria wrote:
1. EDIT: catalog/controller/module/featured.php
2. FIND:3. BEFORE, ADD:Code: Select all
protected function index($setting) {
4. FIND:Code: Select all
private function array_sort_by_column(&$arr, $col, $dir = SORT_ASC) { $sort_col = array(); foreach ($arr as $key=> $row) { $sort_col[$key] = $row[$col]; } array_multisort($sort_col, $dir, $arr); }
5. BEFORE, ADD:Code: Select all
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured.tpl')) {
Code: Select all
$this->array_sort_by_column($this->data['products'], 'product_id', SORT_DESC);
here is my website http://partworntyreleicester.co.uk/ on the main page i have featured module name as best deal of the day.
when i go in featured module and add new product that product go live randomly.
when i go in featured module and add new product that product go live randomly.
Who is online
Users browsing this forum: No registered users and 47 guests