Category browse view template bug in VM 2.0.22a. ignoring global config

Started by marfisk, July 30, 2013, 22:30:49 PM

Previous topic - Next topic

marfisk

The category browse view was locked to show only 1 product across even though the Virtuemart settings were for 3 or 4.

To fix it temporarily, I created an override file for in my theme templates for the category view : html/com_virtuemart/category/default.php and made the following change:
On line 182, it calls for the $this->perRow, which is defaulting to 1 regardless of the config setting
$BrowseProducts_per_row = $this->perRow;

My fix is to add line 69 from view.html.php because it does not seem to be passing the information:
$this->perRow = empty($category->products_per_row)? VmConfig::get('products_per_row',3):$category->products_per_row;


The change does restore dependency on the VM config settings, but it's a work around for a greater logic I haven't researched.


I'm running

PHP Built On    Linux web01 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.41-2+deb7u2~bpo60+1 x86_64
Database Version    5.1.66-0+squeeze1-log
Database Collation    utf8_general_ci
PHP Version    5.2.17
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 2.5.13 Stable [ Ember ] 24-July-2013 14:00 GMT
Joomla! Platform Version    Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT

Using the JSN Decor template, and the Digitoll downloads plugin.

Thanks,
Margaret

Milbo

This is strange,
we do in the category view.html.php this


$perRow = empty($category->products_per_row)? VmConfig::get('products_per_row',3):$category->products_per_row;
$this->assignRef('perRow', $perRow);
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

marfisk

Yes, that's where I got the line from to make it work. But it was not being passed to the default.php for some reason.

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

marfisk

Hmm, okay, I can check that once I get the mirror up because I can change the php setting for a specific folder.

marfisk

I haven't had a chance yet to test this with the higher level of PHP, but I wanted to note that I reported the problem to JSN as well as I discovered it in their templates and it might be an error there rather than in the environment.