Jump to content

Issue with Smarty


t.zak510

Recommended Posts

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

@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

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

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