VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: Mole_LR on January 31, 2012, 14:59:52 PM

Title: Latest products do not show correctly
Post by: Mole_LR on January 31, 2012, 14:59:52 PM
Hello!

Environement: Joomla 2.5 (yesterday updated from 1.7. to 2.5., today just read, that VM 2 is not supported 2.5., but all is working OK without bugs...yet) + Virtuemart 2.0.0.
My Web page's Home page = VirtueMart Default Layout. I choosed to see Categories, Latest products and Top 10 products!

But Recent products do not function properly - it does not display really the latest products (it show some 5 products, but they are old, not Latest)..

Therefore my questions are:
1.)What could be the problem?
2.)Where (in which file) is defined:
2.1.)VirtueMart Default Layout template?
2.2.)Latest products algorythm?

Thank Your for help!
Title: Re: Latest products do not show correctly
Post by: patrickit on February 01, 2012, 10:13:18 AM
Try this solution:
http://forum.virtuemart.net/index.php?topic=95543 (http://forum.virtuemart.net/index.php?topic=95543)
Title: Re: Latest products do not show correctly
Post by: Mole_LR on February 01, 2012, 16:09:59 PM
Thanks! It seems that works! ;-D
Title: Re: Latest products do not show correctly
Post by: Mole_LR on February 08, 2012, 23:40:24 PM
But still not solved in VM 2.0.1e, had to make the hack adding "$orderBy = ' ORDER BY p.`modified_on`  ';" into /administrator/components/com_virtuemart/models/product.php after row 344...

I hope VM team will solve this in next pre/stable-realeses?
Title: Re: Latest products do not show correctly
Post by: patrickit on February 09, 2012, 13:30:52 PM
Thank you Mole_LR for updating us that VM 2.0.1e does not fix the latest products problem.
Title: Re: Latest products do not show correctly
Post by: mchawi on March 14, 2012, 14:28:50 PM
i have tried the suggested hack with no success, i am using VM 2.0 with Joomla 1.7.5. Any quick fix?
Title: Re: Latest products do not show correctly
Post by: patrickit on March 14, 2012, 14:43:03 PM
@mchawi you get any errors? no change in result at all?
Title: Re: Latest products do not show correctly
Post by: mchawi on March 14, 2012, 15:17:50 PM
No error, no changes, i am sure i am changing the right files cause i triend to change something else it throws 500 error,  i am using module override with multilingual feature, can that be source of problem?? For the multilingual part, i am using default Joomla 1.7+ Multilingual feature.
Title: Re: Latest products do not show correctly
Post by: mchawi on March 14, 2012, 15:31:02 PM
Now i know, after putting this code, it fetch products depending on date, either Asc or Desc, it also ignore language setting, it display products from all languages, i have two languages, English and Chinese, is there a way i only fetch from specific category as i selected YES to Use category filter??

//Group case from the modules
if($group){

$groupBy = 'group by p.`virtuemart_product_id`';
switch ($group) {
case 'featured':
$where[] = 'p.`product_special`="1" ';
$orderBy = ' ORDER BY p.`modified_on`  ';   //PL temporary bug fix
                    $this->filter_order_Dir = 'ASC';   //PL temporary bug fix
break;
case 'latest':
$date = JFactory::getDate( time()-(60*60*24*7) ); //Set on a week, maybe make that configurable
$dateSql = $date->toMySQL();
$where[] = 'p.`modified_on` > "'.$dateSql.'" ';
$orderBy = ' ORDER BY p.`modified_on`  ';   //PL temporary bug fix
                    $this->filter_order_Dir = 'ASC';   //PL temporary bug fix
break;
case 'random':
$orderBy = ' ORDER BY p.`modified_on`  ';   //PL temporary bug fix
                    $this->filter_order_Dir = 'ASC';   //PL temporary bug fix
break;
case 'topten';
$orderBy = ' ORDER BY product_sales ';//LIMIT 0, '.(int)$nbrReturnProducts;  //TODO set limitLIMIT 0, '.(int)$nbrReturnProducts;
$this->filter_order_Dir = 'ASC';
}

Title: Re: Latest products do not show correctly
Post by: patrickit on March 14, 2012, 18:46:57 PM
@mchawi I think VM 2.0.2 solves the category filter problem, can you try upgrading your VM and check? It may still require the hack after upgrading.