• Hello,
    I’ve installed the latest version of this plugin 1.61. When I sort the Price from low to high the results are’nt correct.

    After reading the code I found that the callback function for usort (hpy_fdv_sortByPrice()) does not return integer.

    7.6 - 8.2 = -0.6

    as int -0.6 is 0 and interpreted as equal in usort context.

    I changed the function hpy_fdv_sortByPrice:

    function hpy_fdv_sortByPrice($a, $b) {
        if($a['price'] === $b['price']){
    		return 0;
         }
    	return $a['price'] < $b['price'] ? -1 : 1;	
       // return $a['price'] - $b['price'];
    }

    Now, I’ve the expected result. And the plugin works great for me. Hope it helps.

    Regards,
    Sebastian

  • The topic ‘Wrong lowest price variant’ is closed to new replies.