News:

Looking for documentation? Take a look on our wiki

Main Menu

Can we create a module for "You Were Last Looking At" by using this?

Started by rupesh, June 19, 2012, 14:14:08 PM

Previous topic - Next topic

rupesh

Hello friends,

I'm creating a module which shows previous product you have visited before viewing current product for this we have to store
product id for each time you visit the page using     $virtuemart_product_idArray = JRequest::getInt('virtuemart_product_id',0);

so that we can get all product listed using this id!

My question how to track this product id without using virtuemart session for specific user!

for reference see "You Were Last Looking At" module on
"http://www.yebhi.com/46522/PD/bliddyspam-Slippers-Men-L-40202.htm" at bottom of page
Thank you
rupesh

rupesh

on product detail page i have added this!
but insert query wont execute
$user = JFactory::getUser();
      $userId   = (int) $user->get('id');
      if($userId){
         
      $productid = JRequest::getInt('virtuemart_product_id', 0);
     
      $db =& JFactory::getDBO();

      $query="INSERT INTO  tbllastlook (`virtuemart_user_id`, `virtuemart_product_id`)
VALUES ($userId, $productid)";
      //var_dump($query);
   //die;
      //die;
$db->setQuery($query);
$db->query();
      
       }