lakshkhamesra Posted June 2, 2021 Share Posted June 2, 2021 My controller file inside my module (modules\individualpackaging\controllers\front\task.php) :- class IndividualpackagingTaskModuleFrontController extends ModuleFrontController { public function __contruct() { parent::__contruct(); } public function init() { parent::init(); } public function initContent() { parent::initContent(); $this->context->smarty->assign('name', 'john'); $this->setTemplate('module:individualpackaging/views/templates/front/task.tpl'); } } My view file inside my module (modules\individualpackaging\views\templates\front\task.tpl) :- {$name} cart-summary-totals.tpl file (themes\classic\templates\checkout_partials\cart-summary-totals.tpl) :- {include file='module:individualpackaging/views/templates/front/task.tpl'} But it displays nothing. When I preview the task.tpl in browser (mysite.com/module/individualpackaging/task), it displays 'john' successfully, then how come it doesn't get displayed on the cart page? The whole reason I am doing this is because I want to eventually query a custom table in the database and display data on cart page. Link to comment Share on other sites More sharing options...
Rhobur Posted June 3, 2021 Share Posted June 3, 2021 won't work like this, you need to add it through using a hook e.g. displayShoppingCartFooter, there you can insert your tpl; or create your own hook which you;ll have to add into the theme's tpl. 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