Page 1 of 1

Adding Custom Text

Posted: Wed Jan 13, 2010 8:46 am
by jtsroberts
I'm trying to add some custom text to the create account page at index.php?route=account/create

In the markup for catalog\view\theme\default\template\account\create.tpl, I add the line:

Code: Select all

<p><?php echo $text_poboxnotice; ?></p>
Then, in the language file at catalog\language\english\account\create.php, I add the line:

Code: Select all

$_['text_poboxnotice']    = 'Please note, we do not ship to PO Boxes.';
I then clear the system\cache folder except for index.html

I am receiving an error "Notice: Undefined variable: text_poboxnotice in C:\Inetpub\wwwroot\domainname\catalog\view\theme\default\template\account\create.tpl on line 46"

What else do I need to do to add some simple text to a page like this?

Re: Adding Custom Text

Posted: Wed Jan 13, 2010 11:08 am
by jtsroberts
Figured it out. I need to add the line:

$this->data['text_poboxnotice'] = $this->language->get('text_poboxnotice');

in catalog\controller\account\create.php

Re: Adding Custom Text

Posted: Wed Mar 24, 2010 11:00 pm
by jontorbs
Bizarrely I had a similar problem with vouchers not calling the text for buttons at the bottom of the cart page. I had to get round by implementing this fix for cart.php in controller... strange that a fresh install of 1.4.4 would have this problem?

Re: Adding Custom Text

Posted: Wed Mar 24, 2010 11:35 pm
by Qphoria
If you are only supporting one langauge, you can just type it out with html on the tpl file for that page

Re: Adding Custom Text

Posted: Thu Mar 25, 2010 12:45 am
by jontorbs
I found the cause of the problem, it would appear that the calls to define the variables were missing.. however it doesn't explain random parts of my code going missing!