Search the Community
Showing results for tags 'ajax controller'.
-
Hi ! I'm trying to call controller function through an AJAX call in Prestashop 1.5. I don't even know if it's possible. This is what I did : I override product controller (in override/controllers/front/ProductController.php) to load extra medias and to do some actions that the default controller does not do. This is what my controller looks like : <?php class ProductController extends ProductControllerCore { public function setMedia() { parent::setMedia(); // Add extra ressources // CSS & JS $this->addCSS(...) $this->addJS(array(...)); } // Extra methods public function renderCart() { echo '<h2>HELLO</h2>'; } } Here is my question: How can I call my renderCart() function through an AJAX call ? Is that even possible ?
-
Hello, I would appreciate any help on this. I am doing a module... and I need that after pressing some button DIV element would show different content (depending on the response). This is my controllers code: public function initContent() { if(!isset($_GET['oper'])) { //parent::initContent(); $smarty = $this->context->smarty; $tpl_vars['tips_optimization'] = $_SERVER['REQUEST_URI']; $tpl_vars['postvar'] = $_GET['id']; $export = new Export(Db::getInstance(), _DB_PREFIX_); $tpl_vars['result'] = $export->getProductsExcel(); $smarty->assign($tpl_vars); //$this->setTemplate('display.tpl'); } elseif($_GET['oper'] == 'export') { echo("test"); } } After pressing the button and sending the oper parameter with value "export" it responses me with the "Test" text and it packs it inside the template. Is it possible to tell the initContent not to pack the response inside the template? I would like to receive only the plain text. I ve attached already the printscreen how it looks now. This behaviour is not correct We see here administration panel with another administration panel included. Thanks for any hits on this.
-
Hello there, I am developing a new ps1.5 module and get kinda stuck with the following: i want a button in the backend that when pressing it calls an admin controller. I have set the controller in /modules/mymodule/controllers/admin/ajax.php class MymoduleAjaxModuleAdminController extends ModuleAdminController{ } i want to do this with an admincontroller because I don't want people to be able to call the ajax.php without admin rights. Now what I cannot figure out is what the link to this controller is. The frontcontroller is not a problem (Link::getModuleLink() ) but i can find no solution for the admin controller link. any help is most appreciated regards, Eric