Jump to content

Include customized .tpl file inside hook prestashop


Tje123

Recommended Posts

I'm new to prestashop and i'm trying to develop new carrier module for my prestashop project.

 

**Requirement :**

 

customer allow to schedule delivery (add date time).

 

**what i want to do :-**

 

when customer select  (`Schedule delivery`), i want to display calendar to select date. 

 

 

**So far what i did :-**

 

i have crated new module for carrier (`Schedule delivery` carrier in image).

 

created .tpl file inside `views/templates/front/Carrier.tpl`.

 

Created class file inside `Controllers/front/Carrier.php`.

 

 

**Carrier.tpl**

 

    <div id="mymodule_block_home" class="block">

      <h4>Welcome!</h4>

      <div class="block_content">

        <p>Calender</p>

        <ul>

          <li><a href="{$my_module_link}" title="Click this link">Click me!</a></li>

        </ul>

      </div>

    </div>

 

 

**Carrier.php**

 

    class delivery_schedulerCarrierModuleFrontController extends ModuleFrontController

    {

      public function initContent()

      {

        parent::initContent();

        $this->setTemplate('module:delivery_scheduler/views/templates/front/Carrier.tpl');

      }

    }

 

in main `delivery_scheduler.php`,i have added bellow code to import .tpl file.but nothing showing .

 

    public function hookUpdateCarrier($params)

        {

          return $this->display($this->_path.'views/templates/front/Carrier.tpl');

        }

 

 

 

 

 

post-1441108-0-12559500-1508311103_thumb.jpeg

Edited by Tje123 (see edit history)
Link to comment
Share on other sites

i have added both displayCarrierList,displayBeforeCarrier like below.but nothing showing 

 

  public function hookdisplayCarrierList() {

    return "Test";
    }
    public function displayBeforeCarrier() {
    return "Test";
    }
 
At least i cant show "Test" message below to carrier option
Edited by Tje123 (see edit history)
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...