Jump to content

Fatal error: Call to undefined method Product::getProductsImages() ?


ricky11

Recommended Posts

I checked line 30 and found this.

 

public function initContent()
{
parent::initContent();
/************************* Images Array ******************************/
 
$image_array=array();
for($i=0;$i<count($this->cat_products);$i++)
{
if(isset($this->cat_products[$i]['id_product']))
$image_array[$this->cat_products[$i]['id_product']]= Product::getProductsImages($this->cat_products[$i]['id_product']);
}
$this->context->smarty->assign('productimg',(isset($image_array) AND $image_array) ? $image_array : NULL);
 
/************************* /Images Array ******************************/
 
Strange that is is in the overrides folder, i am using default theme... This was upgraded from 1.5 to 1.6.
 
}
 
UPDATE : Uninstalling Layered Navigation module, still produces the same error.
Edited by ricky11 (see edit history)
Link to comment
Share on other sites

How do i do that.. thanks for help.

 

What i was doing is i was uninstalling modules that i was not using.. I saw in displayhead i had over 50 modules installed (most were disabled)  so i was uninstalling it one by one.

 

My index , checkout, product pages are working.. only some pages like category pages and account pages are not working..

 

Where would i change to default category handling?

Link to comment
Share on other sites

Furthur Info :

 

Same error happens when access : new products, price-drop

 

 

Fatal error: Call to undefined method Product::getProductsImages() in /home/iamhome/public_html/override/controllers/front/NewProductsController.php on line 38

 

Really not sure what is going on ....

Link to comment
Share on other sites

Is your cache enabled? Disable it and make a test before continuing.

 

Your Prestashop is using overrides/controllers folders instead of using controllers folder probably after upgrading from 1.5 to 1.6

Let me check some info and see if I help you more.

 

Edit:  lets go step by step

 

- disable all your cache in advanced parameters > performance

- rename your file /cache/class_index.php to something similar to class_index_old.php (you can delete it safely but it is better to do things in a very sensible way)

- then, recharge the page, let PS work a little: it should recreate the class_index.php as it do not find it. 

If file is not recreated, follow the instructions in solved bugs sticky post here: http://www.prestashop.com/forums/topic/351806-sticky-1609-solved-bugs/  > (pint 1)Slow PS performance.

 

Come back and tell us.

Edited by nutxlago (see edit history)
  • Like 1
Link to comment
Share on other sites

HI, So far its like this :

 

For Reference : here is the site in question :  removed. (disabled maint mode for sometime for anyway to check, enabled debugging)

 

1) All caching is disabled and cleared under performance.

2) I could not find the file  /cache/class_index.php...

3) Copied the file PrestaShopAutoload.php , replaced old file

4) Refresh browser and browser cache, several times, still no joy and class_index.php not created 

5) Still same error when go to product pages.

 

 

I am not sure if the problem is related to the cache file not beig created, my site wasn't slow but it wasn't that fast either. what i was doing prior to the site arrest was uninstalling some modules.   

 

I remember that i uninstall a "overrider module" for a previous theme.  Since i am not using this theme anymore, i thought it would be safe to uninstall it.  I also saw this overrider module hooked in to displayheader, it was right at the top position.  After i uninstalled it, the page seemed to load much faster, but it was only later that i discovered that the product pages did not work.

 

if you see the error all of them have something to do with images.  I have tried regen all my thumbnails, still same problem

 

I can't re install the overrider module, because it says unable to install, and can't hook it back.. Its strange because i am not using this theme at all... I did post another question as to how to uninstall a theme properly with overriders... 

 

not sure if i delete the theme folder will make any difference.

 

This is a live site, and i am a little disappointing that these pages are not working.. last thing i need to do is to reinstall from scratch.

 

would love any more suggestions.. once again may have something to do with : getProductsImages

Edited by ricky11 (see edit history)
Link to comment
Share on other sites

Update : class_index.php has appeared, but same problem exits.

 

edit : by default disable all overrides in enabled, i had disabled it, and saw no difference in the error.

 

I will try now deleting my old theme folders, but i know that will not help, because the problem is with the override folder...

Edited by ricky11 (see edit history)
Link to comment
Share on other sites

Possible moment of glory

 

traced the problem back to a old theme that was installed in 1.5, and when upgrading to 1.6 using new default theme.. It looked like the overrider module was positioned no.1 in the displayheader.  

 

When i uninstalled this module, this caused problems because it was no longer in displayheader ...

 

i deleted the theme folder, and refreshed, and the category pages now seem to work.

 

I dont understand the logic here.. but so far so good.

 

thanks for your help, i may still need it... really kept me going.. sometimes you just need a push to look harder.

 

Cheers.

  • Like 1
Link to comment
Share on other sites

Yes it was resolved, simply by deleting the theme directory.

 

to completely uninstall a theme, i wonder if i have to delete all the modules as well, howevers its hard to know which modules are for which theme, because they are all in the main modules folder.

Link to comment
Share on other sites

Ricky, another more experienced user (Vekia), suggested a solution for a similar problem that worked (i cannot find the link right now) just delete the files in override folder which are throwing errors. It is safe to do it, as it seems that old theme created those overrides. Prestashop uses files in /override/ to modify default PS controllers behavior. If no controller file with that name is found there, Prestashop will use its own controllers files.

 

 

So, I suggest you to delete both files which are giving errors in override folder:

 

/home/iamhome/public_html/override/controllers/front/CategoryController.php

 

/home/iamhome/public_html/override/controllers/front/NewProductsController.php

 

Then, delete override/class_index.php again to let PS regenerate it.

 

That should solve all the problems caused by override.

 

Anyway, you can compare a PS 1-6-0-9 with your current PS (with a code compare software). It can help you to see which modules are not in default theme.

Link to comment
Share on other sites

×
×
  • Create New...