t.zak510 Posted May 28, 2019 Share Posted May 28, 2019 Hello, I have Edited the OrderDetailController file and added a simple function to do some tests before implementing desired code: public function SayHello (){ $HelloWorld = "Hello World"; $this->context->smarty->assign('HelloWorld' , $HelloWorld); } and I added the following to my tpl file in my view: <li><strong>Tracking#</strong> {$HelloWorld}</li> All I'm getting is Undefined Index HelloWorld Not sure what's the issue Link to comment Share on other sites More sharing options...
t.zak510 Posted May 28, 2019 Author Share Posted May 28, 2019 anyone please? Link to comment Share on other sites More sharing options...
DataKick Posted May 28, 2019 Share Posted May 28, 2019 are you calling this custom method from display handler? Link to comment Share on other sites More sharing options...
t.zak510 Posted May 28, 2019 Author Share Posted May 28, 2019 @DataKick Please bare with me, I really don't have any clue about what you said, I don't know what is display handler. What I did is to create that code and I added it to Controllers/front/OrderDetailController.php then I went to my themes/My-Theme/templates/customer/order-detail.tpl and I added the second code {$HelloWorld} But no result Link to comment Share on other sites More sharing options...
tdsoft Posted May 29, 2019 Share Posted May 29, 2019 Please upload your OrderDetailController file at here, so everyone can check it Link to comment Share on other sites More sharing options...
DataKick Posted May 29, 2019 Share Posted May 29, 2019 11 hours ago, t.zak510 said: @DataKick Please bare with me, I really don't have any clue about what you said, I don't know what is display handler. What I did is to create that code and I added it to Controllers/front/OrderDetailController.php then I went to my themes/My-Theme/templates/customer/order-detail.tpl and I added the second code {$HelloWorld} But no result If all you did was to create a new function with name SayHello, then it can't work. Although this function exists, it never executes. It's like television that isn't plugged into electrical outlet. What you need to do is *call* this function from somewhere. So you need to find out which code in OrderDetailController is responsible for displaying order-detail.tpl template, and modify *this* code. In your case, you should add following line here: $this->SayHello(); 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