Forums / Templates, Stylesheets, Page Layout / Welcome Guest! Would you like to log yourself in?

Welcome Guest! Would you like to log yourself in?

Locked

Views: 6,161

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
14 Jul 2008, 3:49 AM
#1
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Welcome Guest! Would you like to log yourself in?

I am not sure that I would like a first time visitor in my store to see the default:

Welcome Guest! Would you like to log yourself in?

I would like to replace it with something else: if this is a logged in return customer, then use the default:

Hello first1! Would you like to see our newest additions?
But if this is a visitor (or a return customer who is not logged in for some reason), then see something a little more descriptive than just "Welcome Guest". Something that will describe what this store is about.

I know that this message is in the file includes/languages/english/index.php:

define('TEXT_MAIN','This is the main define statement for the page for english when no\
 template defined file exists. It is located in: <strong>/includes/languages/english/i\
ndex.php</strong>');

// Showcase vs Store
if (STORE_STATUS == '0') {
  define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would y\
ou like to <a href="%s">log yourself in</a>?');
} else {
  define('TEXT_GREETING_GUEST', 'Welcome, please enjoy our online showcase.');
}

define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>! Would you l\
ike to see our <a href="%s">newest additions</a>?');

define('TEXT_INFORMATION', 'Define your main Index page copy here.');

My question is: Is there a more correct way ("Zen Cart wise") to change that "Welcome Guest" text with more elaborate one? Or do I have to touch that PHP file (I don't really like mixing customizable text with code).

Thanks,
Daniel

14 Jul 2008, 4:10 AM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Welcome Guest! Would you like to log yourself in?

Use the override system. Start by reading https://www.zen-cart.com/tutorials/index.php?article=128.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

14 Jul 2008, 4:49 AM
#3
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Welcome Guest! Would you like to log yourself in?

Thanks. Your reply basically confirms that I thought: using the override system and touching that index.php file is the only way to go.

I now need to find a way to avoid "uglifying" that index.php by placing my customized intro text into a separate area. I guess I will have to learn some PHP programming for this.

14 Jul 2008, 5:31 AM
#4
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Welcome Guest! Would you like to log yourself in?

Update: separating the text from the code was easy - I just placed the entire text in a $VARIABLE.

However, the formatting seems "hard coded", so I grep-ed the included subdirectory and found out that the formatting is done at includes/templates/template_default/templates/tpl_index_default.php:

<h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>

Would be nice to change that greeting to something other than H2 formatting.

I know that the intention was to use the DEFINE PAGES EDITOR for define_main_page.php, but the problem is that page is common to both logged-in and not-logged-in users. :(