Pagination is not working when Virtuemart SEO is disabled and joomla SEF enabled

Started by stegov, November 23, 2016, 15:44:29 PM

Previous topic - Next topic

stegov

Hi,
I am running VM 3.0.18 on Joomla 3.6.4, no 3rd-party SEF component

Joomla SEF Settings:
Search Engine Friendly URLs: Yes
Use URL rewriting: Yes
Adds Suffix to URL: No
Unicode Aliases: No

Virtuemart SEF Settings:
SEO Disabled: checked
Seo Suffix: -detail
Translate strings: unchecked
Use Product and Category IDs: unchecked

Product pagination is not working properly, selecting any other page (i.e. page 2 where the final partr of the url is: .../start/24) ust refresh the first page.
This happend on a website I'm working on so I tried installing a clean version of Joomla with the latest virtuemart adding sample products and the problem persists.
I tried different version fo PHP (5.3, 5.5, 5.6) and problem persists.

Any ideas on how to debug and correct this problem?

Thanks in advance.

Thanks in advance.

marcodamico88

I too have the same problema..sembra that with the new version have solved, just that for me installing the new version brings me a blank page with just ordering products and nothing else. I wrote a post, hoping to find a solution.

jenkinhill

@marcodamico88 do not cross-post

@ are you using the default Joomla & VM templates?  Why turn off VM SEO? I always use Joomla+VM SEO.

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

stegov

Hi Kelvyn,
thank for your reply.

It's a standard out of the box installation joomla and VM. You can check it @ http://seba.hot-stuff.it
The specific link where I have the pagination problem is: http://seba.hot-stuff.it/it/catalogo/view/category/virtuemart_category_id/7/lang/it-IT
If you try to switch to page 2 (url: http://seba.hot-stuff.it/it/catalogo/view/category/virtuemart_category_id/7/lang/it-IT/start/24) it doesn't work.

For this specific project I need VM SEO off.

Regards.
stefano


jjk

For some reason it always starts with the first product, no matter which page you select.
Perhaps re-install VM using 3.0.18.5 with the Joomla extension manager and afterwards click on the 'Install or if necessary update tables' button at VM 'Tools & Migration'.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Studio 42

Hi,
The problem is here:
http://seba.hot-stuff.it/it/catalogo/view/category/virtuemart_category_id/7/lang/it-IT/start/15/limit/15
right is http://seba.hot-stuff.it/it/catalogo/view/category/virtuemart_category_id/7/lang/it-IT/limitstart/15/limit/15
Joomla swap limitsart and start for SEF urls, but Virtuemart do not check this case and return start bbut limitstart is needed.

Change in router file
JOOMLASITE\components\com_virtuemart\router.php in function virtuemartParseRoute line 339
if ($helper->router_disabled) {
$total = count($segments);
for ($i = 0; $i < $total; $i=$i+2) {
$vars[ $segments[$i] ] = $segments[$i+1];
}
return $vars;
}

to

if ($helper->router_disabled) {
$total = count($segments);
for ($i = 0; $i < $total; $i=$i+2) {
$vars[ $segments[$i] ] = $segments[$i+1];
}
if(isset($vars[ 'start'])) $vars[ 'limitstart'] = $vars[ 'start'];
return $vars;
}
}


and all should work;)

Milbo

Great work Patrick. Well examined, explained and fix. I add it directly.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

stegov

Hi Patrick,
thanks very much for your help.

I changed the router file as suggested. At first I received a blank page then I realised there was an additional brace.
I used the following code:

if ($helper->router_disabled) {
$total = count($segments);
for ($i = 0; $i < $total; $i=$i+2) {
$vars[ $segments[$i] ] = $segments[$i+1];
}
if(isset($vars[ 'start'])) $vars[ 'limitstart'] = $vars[ 'start'];
return $vars;
}


Now it goes to page 2 but it gets stuck there. If I refresh the page it's still the same but if I go to an upper level (clicking 'catalogo' on the menu) and get back to the 'wear' category (which contains 27 products) I'm on page 2 and I can go to page 1 and back to page 2 but then it gets stuck on page 2.
Any idea why?

Thanks.
Stefano G.

Studio 42

Sorry i have copy past, 1 line more

for return to page 1 problem
replace the code with

if ($helper->router_disabled) {
$total = count($segments);
for ($i = 0; $i < $total; $i=$i+2) {
$vars[ $segments[$i] ] = $segments[$i+1];
}
if(isset($vars[ 'start'])) $vars[ 'limitstart'] = $vars[ 'start'];
else $vars[ 'limitstart'] = 0;
return $vars;
}

rahulsagipl

Quote from: stegov on November 23, 2016, 15:44:29 PM
Hi,
I am running VM 3.0.18 on Joomla 3.6.4, no 3rd-party SEF component

Joomla SEF Settings:
Search Engine Friendly URLs: Yes
Use URL rewriting: Yes
Adds Suffix to URL: No
Unicode Aliases: No

Virtuemart SEF Settings:
SEO Disabled: checked
Seo Suffix: -detail
Translate strings: unchecked
Use Product and Category IDs: unchecked

Product pagination is not working properly, selecting any other page (i.e. page 2 where the final partr of the url is: .../start/24) ust refresh the first page.
This happened on a website I'm working on so I tried installing a clean version of Joomla with the latest VirtueMart adding sample products and the problem persists.
I tried different version fo PHP (5.3, 5.5, 5.6) and the problem persists.

Any ideas on how to debug and correct this problem?

Thanks in advance.

Thanks in advance.

Your problem is similar to one I had but from a different cause. I recently upgraded from PHP5.3.13 to 5.4.37 and pagination no longer worked. That was with Joomla 3.3.6. The problem was with my template which did not work for pagination on the new version of PHP. The solution was to disable the pagination php file provided by the template (I renamed it).

Milbo

Quote from: Studio 42 on November 26, 2016, 12:01:41 PM
Sorry i have copy past, 1 line more

for return to page 1 problem
replace the code with

if ($helper->router_disabled) {
$total = count($segments);
for ($i = 0; $i < $total; $i=$i+2) {
$vars[ $segments[$i] ] = $segments[$i+1];
}
if(isset($vars[ 'start'])) $vars[ 'limitstart'] = $vars[ 'start'];
else $vars[ 'limitstart'] = 0;
return $vars;
}


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