VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: bboom on January 20, 2015, 10:04:21 AM

Title: VM 3.0.3 pagination not working right
Post by: bboom on January 20, 2015, 10:04:21 AM
Hi,

I installed VM 3.0.3 on a development site, I was trying to use the pagination. But when I go to page 2 I cannot go back to page one.

Demo: https://klant38.b-boom.nl/boeken (https://klant38.b-boom.nl/boeken)

Joomla 3.3.6
VirtueMart 3.0.3
Title: Re: VM 3.0.3 pagination not working right
Post by: jenkinhill on January 20, 2015, 11:06:31 AM
As stated many times here, pagination is broken in Joomla 3.3.6 - testing with alpha/beta Joomla 3.4 shows it is repaired fpor that version.
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 30, 2015, 16:57:43 PM
Is there any update on this?

Thank you
Title: Re: VM 3.0.3 pagination not working right
Post by: jenkinhill on January 30, 2015, 17:10:32 PM
Joomla have released Joomla 3.4 beta1 with "stable" release version expected on 17 February.
Title: Re: VM 3.0.3 pagination not working right
Post by: MGHollander on January 30, 2015, 17:17:25 PM
This has something to do with the menu. If a category is a menu item then the pagination breaks. Disable the menu items and it works again. I see you fixed it. Did you fix it yourself or have you installed Joomla 3.4?
Title: Re: VM 3.0.3 pagination not working right
Post by: bboom on January 30, 2015, 17:20:47 PM
I've installed joomla 3.4_dev, it is only a development site, I'll launch that site after the joomla 3.4 release.
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 30, 2015, 17:24:31 PM
Quote from: jenkinhill on January 30, 2015, 17:10:32 PM
Joomla have released Joomla 3.4 beta1 with "stable" release version expected on 17 February.

Thank you for the good news.
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 30, 2015, 17:25:55 PM
Quote from: MGHollander on January 30, 2015, 17:17:25 PM
This has something to do with the menu. If a category is a menu item then the pagination breaks. Disable the menu items and it works again. I see you fixed it. Did you fix it yourself or have you installed Joomla 3.4?

What do you exactly mean by that?
Title: Re: VM 3.0.3 pagination not working right
Post by: MGHollander on January 30, 2015, 17:48:33 PM
Quote from: MAD King on January 30, 2015, 17:25:55 PM
Quote from: MGHollander on January 30, 2015, 17:17:25 PM
This has something to do with the menu. If a category is a menu item then the pagination breaks. Disable the menu items and it works again. I see you fixed it. Did you fix it yourself or have you installed Joomla 3.4?

What do you exactly mean by that?

Well, if you test the pagination of the VirtueMart demo (http://demo.virtuemart.net/pagination-testarea (http://demo.virtuemart.net/pagination-testarea)) you'll notice it works. If you add a menu item with the type "VirtueMart > Category Layout" and you select the category "Pagination testarea" it breaks.
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 30, 2015, 17:54:19 PM
You are referring to VM 2 on Joomla 2.5

I have VM 3.0.3 on Joomla 3.3.6
Title: Re: VM 3.0.3 pagination not working right
Post by: jenkinhill on January 30, 2015, 17:57:07 PM
The demo is VM3 on J2.5 so does not show the Joomla pagination problem.
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 30, 2015, 18:08:40 PM
Thank you jenkinhill for confirming.
Title: Re: VM 3.0.3 pagination not working right
Post by: MGHollander on January 31, 2015, 10:44:19 AM
I know the demo is on J2.5. I think you miss my point.

Install a J3.3.6 with VM3 including test data. Visit the "Pagination testarea" category and notice that pagination will work! Next add a menu item with the type "VirtueMart > Category Layout" and select the category "Pagination testarea". Visit the "Pagination testarea" category and notice that pagination will break... Unpublish the menu item and pagination will work again.
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 31, 2015, 15:38:23 PM
So, what you are saying is that VM 3 has the broken pagination and not Joomla?
Title: Re: VM 3.0.3 pagination not working right
Post by: MGHollander on January 31, 2015, 16:16:11 PM
No thats not what I'm saying. The menu item part is Joomla. What I try to say is the problem only appears when you create a menu item for a category neads pagination.
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 31, 2015, 16:34:57 PM
But I need categories to list my products. How else would you list them?
Title: Re: VM 3.0.3 pagination not working right
Post by: jenkinhill on January 31, 2015, 16:57:47 PM
It is not just VM where pagination problems show. http://bit.ly/1BIA8uQ
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on January 31, 2015, 17:04:00 PM
That was a great animation on the link.
This pagination problem seems to exists for a while on joomla. Why aren't they able to fix this?
Title: Re: VM 3.0.3 pagination not working right
Post by: GJC Web Design on January 31, 2015, 17:41:40 PM
as has been said many many times - fixed on J3.4 .. when it is released stable update
Title: Re: VM 3.0.3 pagination not working right
Post by: MGHollander on January 31, 2015, 17:49:02 PM
It's not about listing your products but it's about creating menu items to those categories. And as sad before. It is fixed in Joomla! 3.4.

For the time being I wrote my own fix.

Create a file in you active templates html directory with the name pagination.php. For example: /template/my-awesome-template/html/pagination.php.
Paste this code in it. It may not be the most beautiful solution, but it worked for me.

Don't forget to remove it after you update to Joomla! 3.4.

<?php
// no direct access
defined('_JEXEC') or die;

function 
pagination_list_render($list)
{
    
// A less beautiful bugfix for pagination in Joomla! 3.3.6 witch will be fixed in Joomla! 3.4
    // http://forum.virtuemart.net/index.php?topic=127793.0
    // More about pagination overrides: https://docs.joomla.org/Understanding_Output_Overrides#Pagination_Links_Overrides
    
$search '/href="(.*)">/';
    
$replace 'href="$1?limitstart=0">';

    
$list['start']['data'] = preg_replace($search$replace$list['start']['data']);
    
$list['pages'][1]['data'] = preg_replace($search$replace$list['pages'][1]['data']);


    
$html "<ul>";
    
$html .= $list['start']['data'];

    
$pages null;
    foreach (
$list['pages'] as $pagenumber => $page) {
        if (
$page['active'] === false && $pagenumber === 2) {
            
$previous preg_replace($search$replace$list['previous']['data']);
        }
        
$pages .= $page['data'];
    }

    
$html .= isset($previous) ? $previous $list['previous']['data'];
    
$html .= $pages;
    
$html .= $list['next']['data'];
    
$html .= $list['end']['data'];
    
$html .= "</ul>";

    return 
$html;

}
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on February 01, 2015, 00:02:45 AM
Thank you, but it did not change anything.
Title: Re: VM 3.0.3 pagination not working right
Post by: mediacompadova on February 09, 2015, 17:25:57 PM
I'm using joomla 3.3.6 with virtuemart 3.0.2 and I've tested on my live site. If SEF is enabled, it doesn't work, only with sef disabled it works. Any suggestions or fix?
Title: Re: VM 3.0.3 pagination not working right
Post by: MAD King on February 09, 2015, 17:31:53 PM
Wait until February 17th. Joomla 3.4 will be released then and it should be fixed, I hope.
Title: Re: VM 3.0.3 pagination not working right
Post by: jenkinhill on March 02, 2016, 20:55:48 PM
@mediacompadova your VirtueMart is severely out of date and your Joomla version should be updated. Both are critcally insecure.

http://virtuemart.net/news/latest-news/473-security-release-virtuemart-3-0-12
http://virtuemart.net/news/latest-news/475-critical-security-leak-in-all-joomla-versions-please-update-immediatly

http://forum.virtuemart.net/index.php?topic=118683.0