Jump to content

search by car modell


spc

Recommended Posts

hello...

 

I´m trying to do my own modules.

 

A modules that let you search by registration nr and car model.

 

I have change so mutch in the file so when i install the modules nothing happends.

I think I have left som info out.

 

the modules install is OK.

 

this is the php script ...

 

<?php
class searchbyvehicle extends Module
{
    protected $maxImageSize = 307200;
   protected $_xml;
    function __construct()
    {
         $this->name = 'searchbyvehicle';
       $this->tab = 'front_office_features';
         $this->version = '0.1';
        parent::__construct();
       $this->page = basename(__FILE__, '.php');
        $this->displayName = $this->l('search by vehicle');
        $this->description = $this->l('search by vehicle');
    }
   function install()
   {
    if (!parent::install() OR !$this->registerHook('home'))
	    return false;
    return true;
   }
   function putContent($xml_data, $key, $field)
   {
    function hookHome($params)
    {
    global $cookie;
    /* Languages preliminaries */
    $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT'));
    $languages = Language::getLanguages();
    $iso = Language::getIsoById($defaultLanguage);
    $isoUser = Language::getIsoById(intval($cookie->id_lang));
         if (file_exists(dirname(__FILE__).'/config.xml'))
             if ($xml = simplexml_load_file(dirname(__FILE__).'/config.xml'))
             {
                  global $cookie, $smarty;
               $smarty->assign(array(
                   'xml' => $xml,
                   'this_path' => $this->_path
               ));
               return $this->display(__FILE__, 'searchbyvehicle.tpl');
           }
       return false;
       }
    }
}
?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...