Jump to content

Include a module's tpl file in cart-summary-totals.tpl


Recommended Posts

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

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