title: creating a module in prestashop: error 'class Module cannot be found'
body: <p>i have a presta module in php4. It works by connecting to the database of a prestashop and prints out xml. Whiles trying to upload to their apps store, they asked i make it php5 and follow certain proceedures.</p>
  
  <ul>
  <li>In a nutshell, its just a full structural code with 1 method that gets connection to a prestashop database and prints out xml.</li>
  </ul>
  
  <p>So the problem is how to get it to conform to the php5 standard required by prestashop. When i tried, i get this error. "class Module cannot be found"</p>
  
  <pre><code>&lt;?php
  include('config/settings.inc.php');
  $con = mysql_connect(_DB_SERVER_, _DB_USER_, _DB_PASSWD_);
  mysql_select_db(_DB_NAME_);
  $str = '_DB_PREFIX_';
  $str1 = constant($str);
  $sql = 'SELECT '.
  $str1.'product_lang.name,'.
  $str1.'product.id_product as id,'.
  $str1.'product.quantity,'.
  $str1.'product.price,'.
  $str1.'product.weight,'.
  $str1.'product_lang.description,'.
  $str1.'product_lang.link_rewrite as url,'.
  $str1.'category_lang.name as category,'.
  $str1.'manufacturer.name as manufacturer,'.
  $str1.'image.id_image '.
  
  'FROM '.
  $str1.'product_lang '.
  'INNER JOIN ' .$str1.'product '.
  'ON ('.$str1.'product_lang.id_product = '.$str1.'product.id_product) '.
  'INNER JOIN ' .$str1.'image '.
  'ON ('.$str1.'image.id_product = '.$str1.'product.id_product) '.
  'INNER JOIN ' .$str1.'manufacturer '.
  'ON ('.$str1.'manufacturer.id_manufacturer = '.$str1.'product.id_manufacturer) '.
  'INNER JOIN ' .$str1.'category_lang '.
  'ON ('.$str1.'category_lang.id_category = '.$str1.'product.id_category_default) '.
  //'WHERE '.$str1.'product_lang.id_lang = 1 AND '.$str1.'category_lang.id_lang = 1';
      'WHERE '.$str1.'product_lang.id_lang = 1';
      $result = mysql_query($sql);
  
       header("Content-Type: text/xml; charset=ISO-8859-1");
       $output = '&lt;?xml version="1.0" encoding="utf-8"?&gt;
       &lt;products&gt;';
       while($row = mysql_fetch_assoc($result)):
       //echo "&lt;br&gt;&lt;br&gt;&lt;b&gt;text:&lt;/b&gt;".$text = addslashes($text);
       $text = str_replace(chr(145), "\'", $text);
   $output .= '
  &lt;product&gt;
      &lt;id&gt;'. $row['id'].'&lt;/id&gt;
      &lt;name&gt;&lt;![CDATA['.$name.']]&gt;&lt;/name&gt;
      &lt;description&gt;&lt;![CDATA['.$text.']]&gt;&lt;/description&gt;
              &lt;image&gt;&lt;![CDATA['. 'http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'img/p/'.$row['id'].'-'.$row['id_image'].'.jpg' .']]&gt;&lt;/image&gt;
          &lt;quantity&gt;&lt;![CDATA['. $row['quantity'] .']]&gt;&lt;/quantity&gt; 
          &lt;price&gt;&lt;![CDATA['. $row['price'] .']]&gt;&lt;/price&gt;
          &lt;weight&gt;'. $row['weight'] .'&lt;/weight&gt;
      &lt;category&gt;&lt;![CDATA['.$category.']]&gt;&lt;/category&gt;
      &lt;manufacturer&gt;&lt;![CDATA['. $manufacturer.']]&gt;&lt;/manufacturer&gt;
              &lt;url&gt;&lt;![CDATA['.'http://'.$_SERVER['HTTP_HOST'].'/product.php?id_product='.$row['id'].']]&gt;&lt;/url&gt;
  
       &lt;/product&gt;';
   endwhile;
  
   print $output .= '
   &lt;/products&gt;';
  </code></pre>
  
  <p>This is the proceedure of coding i need to follow from prestashop</p>
  
  <pre><code>&lt;?php
         //Your class must have the same name than this file.
  
        class module_name extends Module
         {
        public function __construct()
         {
  
      //Name of your module. It must have the same name than the class
      $this-&gt;name = 'module_name';
  
      //You must choose an existing tab amongst the ones that are available
      $this-&gt;tab = 'You choose';
  
      //The version of your module. Do not forget to increment the version for each modification
      $this-&gt;version = '1.0';
  
      //The constructor must be called after the name has been set, but before you try to use any functions like $this-&gt;l()
      parent::__construct();
  
      //Name displayed in the module list
      $this-&gt;displayName = $this-&gt;l('Display Name on Back Office');
  
      //Short description displayed in the module list
      $this-&gt;description = $this-&gt;l('Description On Back Office');    
  }
  
  //You must implement the following methods if your module need to create a table, add configuration variables, or hook itself somewhere.
  //-------------------------------
  public function install()
  {
      return parent::install();
  }
  
  public function uninstall()
  {
      return parent::install();
  }
  //-------------------------------
  
  //Display Configuration page of your module.
  public function getContent()
  {
      return 'Hello World!';
  }
  
     }
  
   ?&gt;
  </code></pre>