Jump to content

Find the working of files of prestashop 1.6.0.5


Recommended Posts

Hi ,

 

Can anyone help me to find how the working of prestashop from its index page to theme files.

Debugging to find when index file is called what happens next  and which function / files are next called etc.

 

Thanks & Regards

 

Jiju

 

Link to comment
Share on other sites

You should read Prestashop Docs > Diving into PrestaShop Core Development > Controllers

 

To understand the working flow about how prestashop displaying a page, can be studied by creating a new page, for example create a new page "my-page"

 

1. Create new controller file "MyPageController.php" and placed inside /controllers/front/

contents :

<?php

class MyPageControllerCore extends FrontController
{
    public $php_self = 'my-page';
    public $auth = true;
    public $ssl = true;

    public function initContent()
    {
        parent::initContent();

        $this->setTemplate(_PS_THEME_DIR_.'my_page.tpl');
    }
}

2. Create template file "my_page.tpl" and placed inside /themes/YOUR_THEME/

contents :

{capture name=path}{l s='My Page'}{/capture}

<h1 class="page-heading">{l s='My Page'}</h1>
<div class="container">
    {l s='Hello World ...'}
</div>

3. Delete file /cache/class_index.php

4. Go to Back Office > Preferences > SEO & URL >> Add New Page

  • Page : mypagecontroller (required)
  • Page title : My Page (optional)
  • Rewritten URL : my-page (required)

5. Finally you can view the result on your Prestashop with this URL http://YOUR_DOMAIN/index.php?controller=my-page

 

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
×
×
  • Create New...