Jump to content

override controller function does not apply


casperravn

Recommended Posts

Hi guys,

 

I am overriding ProductPresentingFrontController.php which is working as expected for the function prepareProductForTemplate.

 

However when i try to put the function prepareMultipleProductsForTemplate in my override file it does not take effect.

And since this function is calling the first function in an array my override does not work.

 

Can anyone explain what goes wrong, please?

Link to comment
Share on other sites

Hi guys,

 

I am overriding ProductPresentingFrontController.php which is working as expected for the function prepareProductForTemplate.

 

However when i try to put the function prepareMultipleProductsForTemplate in my override file it does not take effect.

And since this function is calling the first function in an array my override does not work.

 

Can anyone explain what goes wrong, please?

 

Have you deleted /cache/class_index.php?

Link to comment
Share on other sites

Hi Joseantgv,
 
Thanks for the answer.
 

 

I ended up also overriding SearchController.php with the two functions found in ProductListingFrontController (not ProductPresentingFrontController. Dont know where i got that from.) I made the override functions public.

 

So i now have to override files, ProductListingFrontController and SearchController. First override works on product list, and second works when showing product list from searched products.

 

I am not quite sure what is going on so if anyone can explain why I need to override SearchController with functions from ProductListingFrontController, please help explain why.

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...