Author Topic: [SOLVED]Product navigation completely wrong in VM2, rev 5302  (Read 22688 times)

joao.garin

  • Beginner
  • *
  • Posts: 2
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #15 on: November 22, 2012, 13:30:08 pm »
Hello,

How is this issue fixed?I updated yesterday to version 2.0.14  and I am still getting this problem.

Seems product neighbours wherever they are ordered are getting the wrong order..and I don't seem to find what order that is.Or even where is the file that does this..

Can someone help?

Best regards,
Joao Garin

Spule

  • Beginner
  • *
  • Posts: 3
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #16 on: December 04, 2012, 23:59:34 pm »
Hello,
I found this thread exactly with the same problem as Joao Garin reported (version  2.0.14) ... prev/next seem to show random neighbour products, in Category-Page the order is fine. At virtuemart 1.x it just worked out of the box correctly.

Any hint would be really apreciated.

Regards
Spule

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10451
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #17 on: December 18, 2012, 16:03:05 pm »
It is using always order by $q .= ' ORDER BY `slug` ' . $direction . ' LIMIT 0,' . (int)$max;

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

ccfs70

  • Beginner
  • *
  • Posts: 1
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #18 on: January 15, 2013, 01:59:46 am »
We have migrated to 2.0.18a only to find out that product navigation does not work. You can not go "next" and jump to the next product in that category..Can someone help.
thanks
Carol

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #19 on: January 15, 2013, 14:20:51 pm »
There is nothing solved with VM 2.0.18a. Going forward or backward from product details page with the navigation buttons does choose products from somewhere in the category but not the next or previous product in that category!!

patrik60

  • Guest
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #20 on: January 15, 2013, 23:27:10 pm »
Quote
There is nothing solved with VM 2.0.18a. Going forward or backward from product details page with the navigation buttons does choose products from somewhere in the category but not the next or previous product in that category!!

I don't have this problem any more since a long time. To be sure that it isn't a problem of mine (maybe with other extensions) I have installed a clean Joomla with only the latest VM 2 version with the sample datas on my local environment. Before posting a problem I always check it there. As far as it works fine there I try to find the problems in my configuration.

Did you try this?

Sometimes problems like these remain because using old template overrides. Disabling the whole html folder in the template folder could solve the problem too.

Regards
Patrik

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 856
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always the latest
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #21 on: February 11, 2013, 13:05:17 pm »
We have migrated to 2.0.18a only to find out that product navigation does not work. You can not go "next" and jump to the next product in that category..Can someone help.
thanks
Carol

There is nothing solved with VM 2.0.18a. Going forward or backward from product details page with the navigation buttons does choose products from somewhere in the category but not the next or previous product in that category!!
I have found something which should help you to resolve this problem to some extent.

Product Navigation (Next/Prev) is directly related to the "Default product sort order". For some unknown reason product neighbors array only gets populated when you set the "Default product sort order" field to one of the followings:
  • Product Name
  • Product Short description
  • Product Description
  • Product in stock
  • Product Sales
  • Featured Product

If you set the same to something else for example Product Price or Product Available Date then it does not seem to be working.

"Default product sort order" also decide which products to be displayed when you click on Prev or Next product link.

You may find this helpful if your site is not at all displaying Product Navigation (even after enabling product navigation option in VM Config) and to understand how exactly it works. Default product sort order" field can be found in VM Configuration page under Product Order Settings tab.

Milbo, I am sure there is some problem in the neighbor products array model. Please take a look at it. 

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #22 on: February 11, 2013, 18:13:04 pm »
Well Jumbo this is why I will continue to pay you for templates and support! That fixed the problem however shows that there is a much bigger problem.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

empixmultimedia

  • Beginner
  • *
  • Posts: 1
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #23 on: February 14, 2013, 18:42:49 pm »
this fix work for "Product Sort Order Settings" set to "ordering" in VM2 ver 2.018a
file: administrator/components/com_virtuemart/models/product.php (row: 1258)

         if ($this->filter_order == "pc.ordering")               // added
            $q .= ' and pc.ordering ' . $op . ' ' . $product->ordering .' ';   // added
         else                                    // added
            $q .= ' and `slug` ' . $op . ' "' . $product->slug . '" ';
         
         if ($app->isSite ()) {

            if (is_array ($virtuemart_shoppergroup_ids)) {
               $sgrgroups = array();
               foreach ($virtuemart_shoppergroup_ids as $key => $virtuemart_shoppergroup_id) {
                  $sgrgroups[] = 'psgr.`virtuemart_shoppergroup_id`= "' . (int)$virtuemart_shoppergroup_id . '" ';
               }
               $sgrgroups[] = 'psgr.`virtuemart_shoppergroup_id` IS NULL ';
               $q .= " AND ( " . implode (' OR ', $sgrgroups) . " ) ";
            }
         }
      //   $q .= ' AND (`psgr`.`virtuemart_shoppergroup_id` IS NULL OR `psgr`.`virtuemart_shoppergroup_id`= "'..'"  ';
         if ($onlyPublished) {
            $q .= ' AND p.`published`= 1';
         }
         if(!empty($this->orderByString)){
            $orderBy = $this->orderByString;
         } else {
            $orderBy = ' ORDER BY '.$this->filter_order.' ';   // <-- remove `
         }
         $q .=  $orderBy . $direction . ' LIMIT 0,' . (int)$max;

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #24 on: March 05, 2013, 06:38:39 am »
Can I get a bit more specific details. Is this a find and replace or an add?

I copied your //add and your //<--remove and it still doesnt work. Why is this topic marked as solved?

Here is the file. What did I miss?
Code: [Select]
//}
/////////////////////////////////////////
///////// Added from http://forum.virtuemart.net/index.php?topic=96784.15;topicseen
         if ($this->filter_order == "pc.ordering")               // added
            $q .= ' and pc.ordering ' . $op . ' ' . $product->ordering .' ';   // added
         else                                    // added
/////////////// end the addition
$q .= ' and `slug` ' . $op . ' "' . $product->slug . '" ';
if ($app->isSite ()) {

if (is_array ($virtuemart_shoppergroup_ids)) {
$sgrgroups = array();
foreach ($virtuemart_shoppergroup_ids as $key => $virtuemart_shoppergroup_id) {
$sgrgroups[] = 'psgr.`virtuemart_shoppergroup_id`= "' . (int)$virtuemart_shoppergroup_id . '" ';
}
$sgrgroups[] = 'psgr.`virtuemart_shoppergroup_id` IS NULL ';
$q .= " AND ( " . implode (' OR ', $sgrgroups) . " ) ";
}
}
// $q .= ' AND (`psgr`.`virtuemart_shoppergroup_id` IS NULL OR `psgr`.`virtuemart_shoppergroup_id`= "'..'"  ';
if ($onlyPublished) {
$q .= ' AND p.`published`= 1';
}

if(!empty($this->orderByString)){
$orderBy = $this->orderByString;
} else {
// Original script $orderBy = ' ORDER BY `'.$this->filter_order.'` ';
     $orderBy = ' ORDER BY '.$this->filter_order.' ';   // <-- remove `
}
$q .=  $orderBy . $direction . ' LIMIT 0,' . (int)$max;
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

jthrongard

  • Beginner
  • *
  • Posts: 30
    • Simple CMS Design
Re: Product navigation completely wrong in VM2, rev 5302
« Reply #25 on: March 27, 2013, 18:05:44 pm »
I'm running into the exact same problem - Default order is set to Ordering and MUST remain that way.  Product navigation doesn't work properly.  Same as everyone elses.  Version is 2.0.20b.

Edit - I found a temp solution:http://forum.virtuemart.net/index.php?topic=111450.0

However this isn't a fix. This problem is NOT solved as it requires editting a core file.  Please fix in next update.
Small Business Joomla! Website Design - Simple CMS Design
http://www.simplecmsdesign.com

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #26 on: April 02, 2013, 20:13:08 pm »
That doesn't seem like a real fix either. :( Ill wait to see if they fix it. I wont hold my breath but I will cross my fingers.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10451
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #27 on: April 03, 2013, 02:58:27 am »
The fix is already in the svn and the solution is already in another post,.. lol.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

johnwasneverhere

  • Beginner
  • *
  • Posts: 36
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #28 on: June 02, 2013, 12:39:38 pm »
Umm, jeez thanks for your help milbo! Lol. How bout a link to where it is fixed so I don't have to search for another hour through dozens of unanswered threads on the same topic? Lol not

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3510
  • VirtueMart Version: 3.8.9
Re: [SOLVED]Product navigation completely wrong in VM2, rev 5302
« Reply #29 on: June 02, 2013, 14:01:08 pm »
Johnjeez

Milbo has said that you should get the lates svn, 2.0.21C I believe.

If you dont want to update then extract the relevant code and replace in your version
Regards
A

Joomla 3.9.27
php 7.4