Jump to content

Fatal error: Class 'Image' not found in...


Recommended Posts

Hi all,

 

I use: PrestaShop™ 1.5.6.0

 

I have problem with my XML import:

 

Fatal error: Class 'Image' not found in /www/path/import.php on line 212

 

line 212: $productHasImages = (bool)Image::getImages(1, (int)($product_id));

 

This import work fine on this server: http://fitness-sport.sk/info.php

But problem is with this server: http://hiphop-oblecenie.sk/info.php

 

Image classes are the same in the prestashop /classes

 

Any idea?

 

Thanks for any help.

Link to comment
Share on other sites

Yes, but this code work well on the other server.

 

Here is the code:

 

Function:

 

function addImages($images,$product_id,$product_name=""){ - $images - array of images urls
echo "adding ";
$image_ids=array();
foreach($images as $url){
$productHasImages = (bool)Image::getImages(1, (int)($product_id)); - on this line is the problem
$image = new Image();
$image->id_product = (int)($product_id);
$image->position = Image::getHighestPosition($product_id) + 1;
$image->cover = (!$productHasImages) ? true : false;
$image->legend = createMultiLangField($product_name);
$image->add();
if(!cpimage($product_id,$image->id,"tmp_img.jpg",$image->cover,$image->position)) echo "FAILED COPY<br>";
$image->associateTo(1);
echo "image added";
$image_ids[]=$image->id;
}
return $image_ids[0];
}
 
Is this enough information for you? Do you want whole file?
 
Thanks for your help.
Link to comment
Share on other sites

Thanks for reply.

 

I think, that import file is flawless, because the same file works very well on the other website, where PrestaShop™ 1.5.6.0 is running too.

 

In my opinion the problem can be only on server side (but the web provider told me, that everything is setup correctly, the problem must be on the application side) or application side. I have compared prestashop classes in /classes folder, but classes are same like on the website, where import works well.

 

Do you know, where could be the problem?

 

Really thank you for your time.

Link to comment
Share on other sites

×
×
  • Create New...