News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Product Navigation works good only with Order by Name

Started by restodo, September 08, 2014, 04:00:58 AM

Previous topic - Next topic

restodo

Hi,

I've saw a lot of post reporting this problem.

I'm using VM 2.6.6 and if I navigate products of one category using Order by Name, the navigation works good. But If if choose Order by Price and then navigate, shows some products good (almost 3) but then repeats from product 4 to 3 and again 4 to 3.

I've been watching at function getNeighborProducts and it seems it hasn't any query for Order by Price.

Only found this.

         if(isset($product->$orderByName)){
            $orderByValue = $product->$orderByName;
            if(isset($sp[0])){
               $orderByName = '`'.$sp[0].'`.'.$orderByName;
            }
         } else {
            $orderByName = 'product_name';
            $orderByValue = $product->product_name;
         }

         foreach ($neighbors as &$neighbor) {

            $qm = ' AND '.$orderByName.' '.$op.' "'.$orderByValue.'" ORDER BY '.$orderByName.' '.$direction.' LIMIT 1';
            $db->setQuery ($q.$qm);

            if ($result = $db->loadAssocList ()) {
               $neighbor = $result;
            }

            if($this->filter_order_Dir=='ASC'){
               $direction = 'DESC';
               $op = '<=';
            } else {
               $direction = 'ASC';
               $op = '>=';
            }
         }

Someone could tell me how to modify this funtion to works correct with order by price?


Greets from Argentina.

restodo


restodo

I've been tried many versions of Virtuemart 2.6.10 and this problems happens in all version.

Is there any developer here to try to solve this problem or flag as a Bug?


Greets!