Virtuemart Category Module - categories order issue

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
kiku
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 02 Dec 2013, 14:46

Virtuemart Category Module - categories order issue

Post by kiku » 02 Dec 2013, 15:01

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

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42491
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Virtuemart Category Module - categories order issue

Post by Jan » 03 Dec 2013, 00:35

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
If you find Phoca extensions useful, please support the project

Generaator
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 03 Dec 2013, 09:04

Re: Virtuemart Category Module - categories order issue

Post by Generaator » 03 Dec 2013, 09:34

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

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42491
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Virtuemart Category Module - categories order issue

Post by Jan » 11 Dec 2013, 14:15

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
If you find Phoca extensions useful, please support the project

Post Reply