Jump to content

Embedding AuthController without Header & Footer


antonio9357

Recommended Posts

Hi there!

 

I have a little problem. I created a new controller to give some support options to customers, like FAQ, product informations, orders history, contacts.

 

On click, will append another controller on the page avoiding page reload.

 

Everything is working fine. All controllers are new controllers created by me, displaying the template without header and footer.

 

The problem is the order history controller, that obviously requests authentication. There's no problem with it, until the user is logged. The problem comes on login request: the auth page is appended with header and footer.

 

How can I display AuthController without header and footer and without creating a new "clone" controller?

 

This is my controller:

<?php
class OrderInfoControllerCore extends FrontController
{
    public $auth = true;
    public $php_self = 'orderinfo';
    public $authRedirection = 'support';
    public $ssl = true;

    public function setMedia()
    {
        parent::setMedia();
        $this->addCSS(array(
            _THEME_CSS_DIR_.'support.css',
            _THEME_CSS_DIR_.'history.css',
            _THEME_CSS_DIR_.'addresses.css'
        ));
        $this->addJS(array(
            _THEME_JS_DIR_.'history.js'
        ));
        $this->addJqueryPlugin(array('scrollTo', 'footable', 'footable-sort'));
    }

    /**
     * Assign template vars related to page content
     * @see FrontController::initContent()
     */
    public function initContent()
    {
        parent::initContent();
        $this->display_header = false;
        $this->display_footer = false;
        if ($orders = Order::getCustomerOrders($this->context->customer->id)) {
            foreach ($orders as &$order) {
                $myOrder = new Order((int)$order['id_order']);
                if (Validate::isLoadedObject($myOrder)) {
                    $order['virtual'] = $myOrder->isVirtual(false);
                }
            }
        }
        $this->context->smarty->assign(array(
            'orders' => $orders,
            'invoiceAllowed' => (int)Configuration::get('PS_INVOICE'),
            'reorderingAllowed' => !(bool)Configuration::get('PS_DISALLOW_HISTORY_REORDERING'),
            'slowValidation' => Tools::isSubmit('slowvalidation')
        ));
        $this->setTemplate(_PS_THEME_DIR_.'orderinfo.tpl');
    }
}

Can someone help me with this or should I create a new controller?

 

Thanks in advance!

Link to comment
Share on other sites

  • 3 weeks later...

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