I believe JRequest is deprecated in the latest version of Joomla 3, have rewritten this function:
public function display($tpl = null)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$this->state = $this->get('State');
$this->item = $this->get('Data');
$this->params = $app->getParams('com_car');
$db = JFactory::getDBO();
$user = JFactory::getUser();
// Push a model into the view
$model = $this->getModel();
$modelcar = $this->getModel( 'product' );
$id = JRequest::getVar('id','','default','int');
$vid = JRequest::getVar('vid','','default','int');
$prodDet = $modelcar->loadProduct($id,$vid);
$this->assignRef('prodDet' , $prodDet);
$CatName = $modelcar->getCatName($id);
$this->assignRef('CatName' , $CatName);
}
New Code
public function display($tpl = null)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$this->state = $this->get('State');
$this->item = $this->get('Data');
$this->params = $app->getParams('com_car');
$db = JFactory::getDBO();
$user = JFactory::getUser();
// Push a model into the view
$model = $this->getModel();
$modelcar = $this->getModel( 'product' );
$jinput = JFactory::getApplication()->input;
$id = $jinput->get('id','','default','int');
$vid = $jinput->get('vid','','default','int');
// $id = JRequest::getVar('id','','default','int');
// $vid = JRequest::getVar('vid','','default','int');
$prodDet = $modelcar->loadProduct($id,$vid);
$this->assignRef('prodDet' , $prodDet);
$CatName = $modelcar->getCatName($id);
$this->assignRef('CatName' , $CatName);
Is this the correct fix? Is there a better way to rewrite this method?