public function initContent()
 {
     if (Configuration::get('PST_DISPLAY_NO_MY_ACCOUNT')) {
         Tools::redirect($this->context->link->getPageLink('history'));
     }
     parent::initContent();
 }
Ejemplo n.º 2
0
 public function initContent()
 {
     parent::initContent();
     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);
             }
         }
     }
     $has_address = $this->context->customer->getAddresses($this->context->language->id);
     $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'), 'has_customer_an_address' => empty($has_address), 'voucherAllowed' => (int) CartRule::isFeatureActive(), 'returnAllowed' => (int) Configuration::get('PS_ORDER_RETURN')));
     $this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Hook::exec('displayCustomerAccount'));
     $this->setTemplate(_PS_THEME_DIR_ . 'my-account.tpl');
 }