Prestashop How To do the Web Development of Website. Errors, Issues, Bugs related to Prestashop like Frontend and Backend Development such as Templates, Pdf, Emails, mostly Code Customisations.
Contact Us
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
Contact Us
If you have any query regrading Site and any other issue, please feel free to contact at halflife74159@gmail.com
Pass Controller Variables To TPL in Prestashop In your Controller you can find the initContent() function, where you pass the Value to required tpl. public function initContent() { //assign value like this $username = 'FreemanDev'; parent::initContent(); //and pass here like this ( 'username' => $username) $smarty = $this->context->smarty; $smarty->assign(array( 'username' => $username, )); $content = $smarty->fetch(_PS_THEME_DIR_.'templates/folder/yourtpl.tpl'); $this->context->smarty->assign(array('content' => $this->content . $content)); } and in your tpl (yourtpl.tpl), you can access the above defined variable using curly braces with html tags or simply write. {$username} where ever you need it... Thanks...
AdminController inside Root Admin Folder In Prestashop, We need to store our manually create Admin Controller in Prestashop Database . We must add our Admin Controller class in tab table also. On the root there is admin folder inside the controllers folder. Inside admin folder create your controller file for eg. like AdminNameController.php and save it. After that Register your Controller in Database -> Tab table. You need to define id for tab in (id_tab) field manually according to increment order.(eg: means if id_tab value is 3 you must set id_tab value 4). Parent id (id_parent) is used for make your controller as child for any parent like under SELL Parent (for SELL id_parent set to 2). Next is Position where do you define the Position of your Controller in ADmin Menu Bar.(like if you set position where you want to show the controller in menu bar count from 0 to end menu in the Sell Tab of menu bar and set according to you in between them or last or on first position.
Prestashop PDF Download Error If you got error while downloading pdf file in Prestashop Error : TCPDF ERROR: Some data has already been output to browser, can't send PDF file First of all check the below line of code in classes/pdf/PDF.php in your Prestashop ob_clean(); or ob_end_clean(); is there if ($render) { if (ob_get_level() && ob_get_length() > 0) { ob_clean(); } return $this->pdf_renderer->render($this->filename, $display); } and try to Download pdf file. If it's not working just add below highlighted line of code inside the constructor top in classes/pdf/PDF.php __constructor() function . ob_start(); save file and download your pdf again.
Comments
Post a Comment
If you have any error, bug related to your Prestashop website, Let me know