Page 1 of 1

Virtuemart Category Module - categories order issue

Posted: 02 Dec 2013, 15:01
by kiku
Hi,

Joomla 2.5.16
VM 2.0.24c
mod_phoca_vm_category 1.0.2

I was looking for a solution to my problem on this forum, as I can see there're many topics about not working Phoca Virtuemart Category Module, but I didn't find anything related to my issue... :x

After update to vm 2.0.24c module stop working, so I updated it to 1.0.2, categories are showing, but ordering is totally wrong - module doesn't show categories order as they're on backend, neither alphabetically or by ID. It's nearly alphabetically until last category which start with special letter "Ł".

Before update, module was showing categories ordered by ordering from backend - and that's what I'm trying to get.

How can I solve this?
Any suggestions, please?

Best regards,
Chris

Re: Virtuemart Category Module - categories order issue

Posted: 03 Dec 2013, 00:35
by Jan
Hi, please open this file:
modules\mod_phoca_vm_category\mod_phoca_vm_category.php

and change (cca line 40):

FROM:

Code: Select all

$categories		= $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $category_id );
$categories 	= $categoryModel->getChildCategoryList($vendorId, $category_id);
TO:

Code: Select all

//$categories		= $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $category_id );
$categories 	= $categoryModel->getChildCategoryList($vendorId, $category_id, 'c.ordering');
and (cca line 79):

FROM:

Code: Select all

$childCats 	= $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $c->virtuemart_category_id );
$childCats 	= $categoryModel->getChildCategoryList($vendorId, $c->virtuemart_category_id);
TO:

Code: Select all

//$childCats 	= $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $c->virtuemart_category_id );
$childCats 	= $categoryModel->getChildCategoryList($vendorId, $c->virtuemart_category_id, 'c.ordering');
and let me know if this helped.

Jan

Re: Virtuemart Category Module - categories order issue

Posted: 03 Dec 2013, 09:34
by Generaator
mod_phoca_vm_category_v1.0.2.zip
Joomla! 2.5.16
com_virtuemart.2.0.24c.zip

( ! ) Fatal error: Using $this when not in object context in ...\administrator\components\com_virtuemart\models\category.php on line 121

Code: Select all

	public function getChildCategoryList($vendorId, $virtuemart_category_id,$selectedOrdering = null, $orderDir = null, $cache = true) {

		if($selectedOrdering===null){
			//$selectedOrdering = VmConfig::get('browse_cat_orderby_field','category_name');
line 121:			$selectedOrdering = $this->_selectedOrdering;
		}
		if(!in_array($selectedOrdering, self::$_validOrderingFields)){
			$selectedOrdering = 'category_name';
		}

Re: Virtuemart Category Module - categories order issue

Posted: 11 Dec 2013, 14:15
by Jan
Hi, testing now with 1.0.3 - get no such problem, really no idea what can be wrong in the VM getShilcCategoryList method. Try to update to 1.0.3:

https://www.phoca.cz/download/category/6 ... ory-module

and let me know.

Jan