Tari Posted July 11, 2012 Share Posted July 11, 2012 Hi guys, I need to display history of all customer's messages in front-end. There is this feature in back-end, in service desk but i haven't found anything in user account area. Is it possible? I need some ideas where I should 'dig' for this thing. Thank you in advance! Link to comment Share on other sites More sharing options...
Krystian Podemski Posted July 12, 2012 Share Posted July 12, 2012 (edited) Hello Тариa! I think the best option for you is create new controller called hmm, maybe "MessagesHistory". Here is a list of things that I would want to do if I want to display messages history on specific page in front-end: 1. Create messages-history.php in base PrestaShop folder. Code something like that: require_once(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('MessagesHistoryController')->run(); 2. File controllers/MessagesHistoryController.php And here some example code: class MessagesHistoryControllerCore extends FrontController { public $php_self = 'messages-history.php'; public function process() { parent::process(); if(self::$cookie->is_logged) { $messages = CustomerThread::getCustomerMessages(self::$cookie->id_customer); self::$smarty->assign('messages',$messages); } } public function displayContent() { self::$smarty->display(_PS_THEME_DIR_.'messages-history.tpl'); } } 3. Now create messages-history.tpl in your theme directory and use $messages variable. 4. Now put link to this page for example in blockmyaccount Of course is a only a example. Have fun with coding. If you have more questions, just write. Edited July 12, 2012 by Krystian Podemski (see edit history) Link to comment Share on other sites More sharing options...
Tari Posted July 14, 2012 Author Share Posted July 14, 2012 Thank you for great explanation and ideas, Krystian!! I'm on my way to figure all this out Link to comment Share on other sites More sharing options...
kkmixs Posted October 27, 2013 Share Posted October 27, 2013 I want this features.I want to show my backend customer message in fornt end store in a sperate CMA page such that my customer can read it.Please help me how can i show the backend message in front end? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now