Post by picstart » Sun Apr 22, 2012 6:53 pm

I have found the file and line that needs to be changed

Code: Select all

$_['text_logged']   = 'You are logged in as <a href="%s">%s</a> <b>(</b> <a href="%s">Logout</a> <b>)</b>';

that shows the users first name when logged in in the header area. what i cant see is how i can relate the login message to show the company name and not the users first name as below. I

existing display
You are logged in as Marie ( Logout

would like to change it to
You are logged in as 'company name field' ( Logout

thanks

New member

Posts

Joined
Fri Dec 09, 2011 6:44 am

Post by Tcalp » Sun Apr 22, 2012 9:25 pm

It is this line of code

Code: Select all

$this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', 'SSL'), $this->customer->getFirstName(), $this->url->link('account/logout', '', 'SSL'));
From catalog/controller/common/header.php

Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite

Image
irc.freenode.net #opencart


User avatar
Active Member

Posts

Joined
Wed Jul 06, 2011 1:49 pm

Post by picstart » Mon Apr 23, 2012 4:09 am

Have tried modding this code below can someone tell me if i am on the right lines as when i change it to the code below i just get a blank screen instead of the home page, i am guessing i have to change a combination of the link path , where it says customer and the getFirstName parts

Code: Select all

$this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', 'SSL'), $this->customer->getFirstName(), $this->url->link('account/logout', '', 'SSL'));
changed to :

Code: Select all

$this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/address', '', 'SSL'), $this->customer->getCompany(), $this->url->link('account/logout', '', 'SSL'));

New member

Posts

Joined
Fri Dec 09, 2011 6:44 am

Post by picstart » Tue Apr 24, 2012 4:34 am

Have exhausted all my ideas if i change this from anything but first name or last name the page does'nt load it just stays black , anyone know if it can be done or am i trying to edit the wrong file?

New member

Posts

Joined
Fri Dec 09, 2011 6:44 am

Post by Tcalp » Tue Apr 24, 2012 6:34 am

Your editing the correct file .. sort of ...

except it is more complicated (just had a look about the source).

./system/library/customer.php contains the functions in question, which doesn't include a getCompany() function, so you would have to create one. Also 'Company' at least by default is not a standard field in Open Cart (outside of addresses) so you would have to do a look-up from there, and then maybe fall back to customer name on company name being blank.

Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite

Image
irc.freenode.net #opencart


User avatar
Active Member

Posts

Joined
Wed Jul 06, 2011 1:49 pm
Who is online

Users browsing this forum: No registered users and 67 guests