Author Topic: Product next/previous navigation looping  (Read 351 times)

julash

  • Beginner
  • *
  • Posts: 20
Product next/previous navigation looping
« on: September 13, 2017, 08:18:35 am »
Hi,

Not sure if this is a bug. Product navigation not working with a loop of same 2 product. I found this problem also on virtuemart demo site. Check http://demo.virtuemart.net/skirt-knock-rock-detail or http://demo.virtuemart.net/cap-baseball-detail and try going next/previous products. At some point both next/previous keep looping in same products.

First found the problem on a website I am developing with virtueMart 3.2.2 and joomla 3.7.4.

Thanks
Julash

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 179
    • Bulgarian Computer Store
Re: Product next/previous navigation looping
« Reply #1 on: September 13, 2017, 09:54:22 am »
I can not confirm this. The switching of demo site products works well.
No pain, no gain, no site!

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1142
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.6
Re: Product next/previous navigation looping
« Reply #2 on: September 13, 2017, 10:01:07 am »
Hello

I can confirm the faulty behaviour.

Choose cowboy hat and click on next. Now You start looping between Safety helmet nad Cap baseball.
Choose skirt and click on next. Now You start looping between Dress shirt with tie and T-shirt Classic blue.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.8.2
Virtuemart 3.2.6
Olympiantheme Hera (customized)

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 179
    • Bulgarian Computer Store
Re: Product next/previous navigation looping
« Reply #3 on: September 13, 2017, 10:23:34 am »
Oh yeah. That's right. Cool.  :)
No pain, no gain, no site!

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2410
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product next/previous navigation looping
« Reply #4 on: September 13, 2017, 23:49:31 pm »
Simply click on "previous" product and you see it loop from H20 Jacket to Skirt to H20 Jacket ....

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9412
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Product next/previous navigation looping
« Reply #5 on: October 23, 2017, 13:37:13 pm »
The problem is here, that the ordering must be correctly determined, else you get this effect. It is very hard to avoid it. The real solution would be an own temporary list keeping the product order. Please check the demo here http://demo.virtuemart.net/ghd-2-07-detail

The reason is, that any call to the db is new and has no knowledge about the last. So the real order can differ from call to call. The sql executes the same as for the browsing view, just with an extra filter, which excludes the current product.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/