News:

Support the VirtueMart project and become a member

Main Menu

Recen viewed Products Not working in Virtuemart 3.0.18

Started by leoalv, January 05, 2017, 15:28:16 PM

Previous topic - Next topic

leoalv

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.