VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: leoalv on January 05, 2017, 15:28:16 PM

Title: Recen viewed Products Not working in Virtuemart 3.0.18
Post by: leoalv on January 05, 2017, 15:28:16 PM
Hello, I am creating a virtual store from the sample data. I have noticed that the section for recently viewed products, do not work. I have tested it in Wamp with php56 and php7.

Apparently the problem occurs in the shopfunctionsf.php file. Exactly between lines 353 to 361. The code is as follows

   static public function getRecentProductIds ($nbr = 3) {

$session = JFactory::getSession();
$ids = $session->get( 'vmlastvisitedproductids', array(), 'vm' );
if(count( $ids )>$nbr) {
array_splice( $ids, $nbr );
}
return $ids;
}


$nbr = 3 is assumed, but for some reason if you change the $nbr by an integer into array_splice ($ids, 3); it works.