title: Prestashop image URL
body: <p>I am trying to get image URL for prestashop product depending on it's ID. 
  I am trying this code for methods provided by prestashop, but I get nothing </p>
  
  <pre><code>&lt;?php
  
  //require('config/settings.inc.php');
  //require('classes/Image.php');
  require('classes/Link.php');
  $ItemID=$_GET["catID"];
  $db=mysql_connect(constant('_DB_SERVER_'),constant('_DB_USER_'), constant
  
  
  $image = Image::getCover($ItemID);
  $imagePath = Link::getImageLink($product-&gt;link_rewrite, $image['id_image'], 'home_default');
  </code></pre>
  
  <p>this code is not working, I tried to add the required classes but they also produce a problem. Also if I commented last two line the require itself produces an error. 
  My other working code that I am planing to build a table of images URL manually is working </p>
  
  <pre><code>&lt;?php
  require('config/settings.inc.php');
  $ItemID=$_GET["catID"];
  $db=mysql_connect(constant('_DB_SERVER_'),constant('_DB_USER_'), constant
  
  ('_DB_PASSWD_')) or die('Could not connect');
  mysql_select_db(constant('_DB_USER_'), $db) or die('');
   if (is_numeric($ItemID)) {
  $result = mysql_query("SELECT name,date_add,price , IFNULL(imageURL,'') as imageURL 
  
  FROM product inner join product_lang on product_lang.id_product=product.id_product 
  
  left join app_product_image on product.id_product=app_product_image.id_product where 
  
  id_lang=1 and product.id_product='$ItemID'") or die('Could not query');
  $json = array();
      if(mysql_num_rows($result)){
             // $row=mysql_fetch_assoc($result);
          while($row=mysql_fetch_row($result)){
              //  cast results to specific data types
  
              //$test_data[]=$row;
                  $json['name']=$row[0];
                  $json['date']=$row[1];
                  $json['price']=$row[2];
                  $json['imgURL']=$row[3];
  
          }
         // $json['products']=$test_data;
      }
     echo json_encode($json);
      mysql_close($db);
  
  
   }
  </code></pre>
  
  <p>the above code is the last solution but i am trying not to write the product-image URLs manually!</p>