vikasmnl Posted February 17, 2017 Share Posted February 17, 2017 Hi all, I want to add a new page in customer account, where he can upload and store his personal jpeg's or pdf's in respective category. Plz help how can i create the same. Thanks. Link to comment Share on other sites More sharing options...
YopixelAE Posted February 18, 2017 Share Posted February 18, 2017 (edited) Hello, Firstly create a tab-link in your themes/yourtheme/my-account.tpl. For example : <p class="info-account">{l s='Welcome to your account. Here you can manage all of your personal information and orders.'}</p> <div class="row addresses-lists"> <div class="col-xs-12"> <ul class="myaccount-link-list"> <li><a href="{$link->getPageLink('mypage', true)|escape:'html':'UTF-8'}"><span>{l s='My Page'}</span></a></li> [...] Then create a controller. For example controllers/front/myPageController.php : <?php class MyPageControllerCore extends FrontController { public $auth = true; public $php_self = 'mypage'; public $authRedirection = 'mypage'; public $ssl = true; protected $customer; public function init() { parent::init(); $this->customer = $this->context->customer; } public function postProcess() { return $this->customer; } public function initContent() { parent::initContent(); $id_customer = $this->customer->id; $this->context->smarty->assign(array( 'id_customer' => $id_customer, )); $this->setTemplate(_PS_THEME_DIR_.'mypage.tpl'); } public function setMedia() // Optionnal { parent::setMedia(); $this->addCSS(_MODULE_DIR_.'...PATH...mypage.css'); $this->addJS(_MODULE_DIR_.'...PATH...mypage.js'); } [...] } Then create your template file. For example themes/yourtheme/mypage.tpl (page displayed when tab is clicked). Inside this page, you include a custom hook. Finally in this hook you transplant your module (which handles -in connexion with the controller you created before-) the customer's actions, i.e uploads). Edited February 18, 2017 by Yopixel (see edit history) 2 Link to comment Share on other sites More sharing options...
tivicrdotcom Posted June 24, 2017 Share Posted June 24, 2017 Awesome, let' say I just want to create an iFrame to display info from within the server? So when the customer clicks on the link it will display an iFrame with whatever I want in it? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now