News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Products per page not working after updating viruemart to 3.2.2

Started by Ventsi Genchev, May 19, 2017, 10:49:23 AM

Previous topic - Next topic

Ventsi Genchev

Maybe I have to explain better with pictures:
Picture 1: Template Configuration.
Picture 2: Category Configuration.
Picture 3: First category loading.
Picture 4: What the drop-down menu shows to select the number of products per page.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Ventsi Genchev

And
Picture 5: After selecting 3 products per page - what the dropdown menu shows to select a number of products per page
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

rage76

Dear Jenkinhill Sir

Do you mean that we have to manually configure the number of products to be shown by specifying in each and every category & subcategory?

In earlier versions, this was set in the main config, and it would be default for all categories & sub-categories.


AH

You only need to set category configuration within VM

The categories will inherit this setting if you leave their values to "default"

This is the same for all of these category settings

Changing things at a category level allows you to override the main configuration for that category
Regards
A

Joomla 4.4.5
php 8.1

rage76

Dear AH

It's not working. That's what this thread is all about.

Maybe we are missing something. Please guide.

rgds

jenkinhill

Currently ""Initial number of listed items"" is on;y available on a per category configuration. Alternatively you can set the pagination configuration "Frontend default items per list view" but that does not only affect products, it affects categories as well.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Milbo

Thank you for the nice explanation. A bit unconsistent on the first look, but it makes sense with the feature for differtn pagination option per category, which can have different numbers of products per row.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Ventsi Genchev

I think you can not understand me correctly. I guess the reason is in my English.
Let me try again to explain:

The problem is the number of products per page. No problem with number of products per row.

After the change of router.php in VM version 3.2.2, they no longer work:
VirtueMart » Configuration » Templates » Frontend default items per list view
and
VirtueMart » Product Categories » Edit Category » Product Category Form » Initial number of listed items

That they do not work is due to the addition of the number 20 in the router.php in the following line:
self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limit', VmConfig::get('list_limit', 20), 20, 'int');

More precisely here:
VmConfig::get('list_limit', 20), 20, 'int')

I hope that I have explained this time properly.
BR
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Milbo

yeh but
products per rows multiplied by rows, =>products per page.

and the function is defined as
public function getUserStateFromRequest($key, $request, $default = null, $type = 'none')

We use

self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limit', VmConfig::get('list_limit', 20), 20, 'int');


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

Milbo

It is a value, stored in the session. When you change it in the BE, it is ignored as long you keep your old session. You need to login/logout, or logout/login to test the new value
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Ventsi Genchev

Login, Logout, delete cookies, delete cache - no effect.

If I changed from 18 to 3 in one category, I switched to another and when I returned to the first one again it was 18.
Always see 18 products per page.
Because the number 18 is closest to the number 20 added in router.php. My settings are: "For 3 items per row = 6,12,18,24,48".

Honestly, I have no idea why this happens, but I've tested every file after the update until I find out where the problem comes from.
The fact is that when I delete the number 20 from the router.php, everything works normally as before. And for each category I can set how many products I want to have on a page.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Ventsi Genchev

I just did the following experiment:

I changed 20 to 10:
self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limit', VmConfig::get('list_limit', 20), 10, 'int');
The number of products when you opened a page immediately became 9

I changed 20 to 30:
self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limit', VmConfig::get('list_limit', 20), 30, 'int');
The number of products when you opened a page immediately became 30

I changed 20 to 40:
self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limit', VmConfig::get('list_limit', 20), 40, 'int');
The number of products when you opened a page immediately became 39

I changed 20 to 50:
self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limit', VmConfig::get('list_limit', 20), 50, 'int');
The number of products when you opened a page immediately became 48

It does not really matter what the VM category settings are.
BR
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

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/

Ventsi Genchev

No:
VirtueMart » Configuration » Templates » Frontend default items per list view
and
VirtueMart » Product Categories » Edit Category » Product Category Form » Initial number of listed items
not works.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

rage76

I am surprised why others have not faced this issue !!

Venci, I even tried removing the "20" from router.php but it still didn't work for me...