News:

Looking for documentation? Take a look on our wiki

Main Menu

Latest products do not show correctly

Started by Mole_LR, January 31, 2012, 14:59:52 PM

Previous topic - Next topic

Mole_LR

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!


Mole_LR


Mole_LR

#3
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?

patrickit

Thank you Mole_LR for updating us that VM 2.0.1e does not fix the latest products problem.
I adore Joomla & Virtuemart!

mchawi

i have tried the suggested hack with no success, i am using VM 2.0 with Joomla 1.7.5. Any quick fix?

patrickit

@mchawi you get any errors? no change in result at all?
I adore Joomla & Virtuemart!

mchawi

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.

mchawi

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';
}


patrickit

@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.
I adore Joomla & Virtuemart!