VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: snewpers on December 28, 2011, 14:02:25 PM

Title: VirtueMart Products Module not filtering.
Post by: snewpers on December 28, 2011, 14:02:25 PM
Heya

the 'VirtueMart Products' module does not filter correctly. I have multiple categories, and when I have more than one 'VirtueMart Products' module enabled it does not filter anything but the first active module eg:  On page 1 it should filter products of category 1, On page 2 (duplicate module) it should filter products from category 2, etc.

I have assigned the modules to the correct menus, but only the contents of 'page 1/category1' is displayed in all modules. So it seems that the modules load just fine (module header updates the name) but the products stay the same.

Any hints anyone?

--- ETA---
Seems that the module ignores category filtering. It also does not work correctly when 'latest products' is selected: it'll show the first 2 products.
When for instance 'Random' is selected, it'll show random images from the whole productrange, again ignoring any filtering.

Too bad.
Title: Re: VirtueMart Products not filtering.
Post by: PRO on December 28, 2011, 14:57:14 PM


I have reported this bug
Title: Re: VirtueMart Products not filtering.
Post by: snewpers on December 28, 2011, 15:04:25 PM
Cool, thank you for letting me know.
You have a link for your post so I can keep track of it?

Snewp.

ETA:

@BanquetTables.pro
You mentioned it's a category ID problem. Is that also the reason why 'top ten' and 'latest items' are showing the products with the lowest (oldest) ID, instead of the ones it *should* show?
If so, I can stop looking for the error I might have made ;)
Title: Re: VirtueMart Products Module not filtering.
Post by: patrickit on February 01, 2012, 10:07:43 AM
For those of you still having this problem and cannot wait for the bug fix, I have solved it by doing the below:
In administrator/components/com_virtuemart/models/product.php
Look for around line 334
$where[] = 'p.`modified_on` > "'.$dateSql.'" ';

add after it
$orderBy = ' ORDER BY p.`modified_on`  ';   //PL temporary bug fix
$this->filter_order_Dir = 'DESC';   //PL temporary bug fix

See sample here: http://x-doria.ae/ (http://x-doria.ae/)

I am using Joomla 1.7.3 virtuemart 2.0
That fixed my problem. I don't know how good the code is, or if it breaks anything else, it's working fine for me.
Title: Re: VirtueMart Products Module not filtering.
Post by: Milbo on February 01, 2012, 22:34:24 PM
Do you have the same probelm with 2.0.1?
Title: Re: VirtueMart Products Module not filtering.
Post by: patrickit on February 02, 2012, 08:19:03 AM
Hello Milbo,

Haven't tried 2.0.1, I have 2.0.0 according to my VM control panel.
So far it is working great so I won't upgrade now.

Amazing product.

Thanks!!
Title: Re: VirtueMart Products Module not filtering.
Post by: brentonking on February 03, 2012, 06:31:51 AM
I grabbed the .php files from the 2.0.1 pre-release (mod_virtuemart_product) but didn't make any difference, the categories still don't filter proper. Is there another file(s) I need to change instead?
Title: Re: VirtueMart Products Module not filtering.
Post by: patrickit on February 03, 2012, 13:37:11 PM
Brentonking,

My solution just solves the latest products problem, it does not solve the category filter one. I haven't tried fixing the category filter as I hadn't needed this feature.
If you want the best sellers to work then I have a workaround too.
Title: Re: VirtueMart Products Module not filtering.
Post by: brentonking on February 04, 2012, 02:34:12 AM
partickit,

Yep, I did realise that. I just noticed the original post had also mentioned the category filter issue. And I was just following up on that. Wasn't expecting your fix to work for it, was more trying to give a secondary answer to Milbo's question regarding 2.0.1.
Title: Re: VirtueMart Products Module not filtering.
Post by: brentonking on February 04, 2012, 05:39:48 AM
Update: 2.0.1 D fixes the category filtering issue! Nice work VM team!
Title: Re: VirtueMart Products Module not filtering.
Post by: patrickit on February 09, 2012, 13:36:22 PM
Mole_LR updates us that VM 2.0.1e does not fix the latest products, best seller problem in the product module http://forum.virtuemart.net/index.php?topic=97284.msg322174#msg322174 (http://forum.virtuemart.net/index.php?topic=97284.msg322174#msg322174)