VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: rupesh on June 19, 2012, 14:14:08 PM

Title: Can we create a module for "You Were Last Looking At" by using this?
Post by: rupesh on June 19, 2012, 14:14:08 PM
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
Title: Re: Can we create a module for "You Were Last Looking At" by using this?
Post by: rupesh 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();
      
       }