Author Topic: Products per page not working after updating viruemart to 3.2.2  (Read 3059 times)

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 144
    • Bulgarian Computer Store
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.
No pain, no gain, no site!

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 144
    • Bulgarian Computer Store
And
Picture 5: After selecting 3 products per page - what the dropdown menu shows to select a number of products per page
No pain, no gain, no site!

rage76

  • Jr. Member
  • **
  • Posts: 125
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2602
  • VirtueMart Version: 3.2.4
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 3.7.4
php 5.6 + php 7

rage76

  • Jr. Member
  • **
  • Posts: 125
Dear AH

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

Maybe we are missing something. Please guide.

rgds

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26314
  • Always on vacation
    • Jenkin Hill Internet
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

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

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

Currently using VM3.2.4 on Joomla 3.8 PHP 7.0.23

Testing VM3.2.5.9653 on J!3.8

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 144
    • Bulgarian Computer Store
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #22 on: June 13, 2017, 08:38:50 am »
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:
Code: [Select]
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
No pain, no gain, no site!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #23 on: June 13, 2017, 08:54:51 am »
yeh but
products per rows multiplied by rows, =>products per page.

and the function is defined as
Code: [Select]
public function getUserStateFromRequest($key, $request, $default = null, $type = 'none')
We use
Code: [Select]
self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limit', VmConfig::get('list_limit', 20), 20, 'int');

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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #24 on: June 13, 2017, 09:14:32 am »
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
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 144
    • Bulgarian Computer Store
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #25 on: June 13, 2017, 09:22:49 am »
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.
No pain, no gain, no site!

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 144
    • Bulgarian Computer Store
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #26 on: June 13, 2017, 09:33:14 am »
I just did the following experiment:

I changed 20 to 10:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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
No pain, no gain, no site!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #27 on: June 13, 2017, 10:47:43 am »
So the main config works, just not per category?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 144
    • Bulgarian Computer Store
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #28 on: June 13, 2017, 10:54:04 am »
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.
No pain, no gain, no site!

rage76

  • Jr. Member
  • **
  • Posts: 125
Re: Products per page not working after updating viruemart to 3.2.2
« Reply #29 on: June 13, 2017, 19:23:21 pm »
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...