Author Topic: Can we create a module for "You Were Last Looking At" by using this?  (Read 1345 times)

rupesh

  • Jr. Member
  • **
  • Posts: 113
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

  • Jr. Member
  • **
  • Posts: 113
Re: Can we create a module for "You Were Last Looking At" by using this?
« Reply #1 on: June 19, 2012, 15:39:27 pm »
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();
      
       }