Jump to content

PS 1.7.7.1 | How to call class method in OrderController ?


Recommended Posts

Hmmm ... I'm not sure what is wrong with my dev site on live server because in my locahost the order message was displayed normally and the debug code show the messages as it should. However I still can't figuring out how to call class method inside Prestashop > Symfony controller ...

$debug_message = $orderForViewing->getMessages();
dump($debug_message);
exit;

image.thumb.png.262a8935e94453a0d7f0b43a0859e7fb.png

 

Link to comment
Share on other sites

Ok please forget about order message issue, since I already figuring out what is the cause of the problem.
NOTE:
order message issue in here are happened on Dev Site which are the upgraded version from an old PS version
the related/necessary data are missing from the database which cause order message are not displayed on admin order

Back to the topic of this thread which is "How to call class method in OrderController ?"
I guess since PS 1.7.7.0 we can't call Prestashop class method anymore directly from PS-symfony controller
we had to override the related controller by creating custom module and then call PS class method from there

If someone know how to call Prestashop class method (directly) inside PS-symfony controller please let me know how ... 

Link to comment
Share on other sites

PROBLEM SOLVED 

Basically it's so simple ... but sometime forgotten

OrderController.php yet declare the necessary class which require to call the corresponding class method.
So simply (add) declare following code in the top of the file along with the available code declarations

use Db;
use PrestaShopDatabaseException;


 

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