Ok. I’ve just got this software and am a bit like everyone else. Frustrated with all the coding and the work needed to customize your page. My problem is that I never worked with PHP. So it’s like me flying over to China and not knowing how to speak Chinese. Yeah. Well going through the forums I see people asking for help and a lot of the times they just get sent to another page. And the page that tells you how to make a new template tells you simply how to make a stupid folder to start your template. And a little CSS helper with changing colors and crap. And saying well find the page you want to edit and go from there. Well you don’t really say how to edit the page. Anyways make a webpage is easy enough but when you are reading this php code included it’s confusing so this is a my newbie understanding of some of the code possibly to help others gain an understanding. I believe this is all correct and I believe it’s best to understand how something works before just jumping in and playing around. Noting I used the developers tool kit to search for the definitions and putting my own knowledge to this. This is a portion of the tpl_header.php and a stab at understanding it.

<div id="navMain">
<ul class="back">
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>

HTTP_SERVER is my domain name www.mydomain.com and is located in public_html/shoppingcart/includes/configure.php

DIR_WS_CATALOG is the shopping cart location http://www.mydomain.com/shoppingcart and is located in public_html/shoppingcart/includes/configure.php

HEADER_TITLE_CATALOG is the text “Home” and is located in
public_html/shoppingcart/includes/languages/english/header.php
(note this is where it defines the text home go here to change)


<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>

FILENAME_LOGOFF is the command “Logoff” which entails a command to logoff when a customer is logged in. The IF implies these statements occur when the customer is logged in. This is defined in /public_html/shoppingcart/includes/filenames.php

HEADER_TITLE_LOGOFF is the text “Log out” defined in /public_html/shoppingcart/includes/languages/english/header.php

FILENAME_ACCOUNT is defined as “account” sending this command. It is located in
public_html/shoppingcart/includes/filenames.php

HEADER_TITLE_MY_ACCOUNT is the text “My Account” defined in public_html/shoppingcart/includes/languages/english/header.php

Now this is an if…else.. statement <?php if ?> <?php }else { which implies that if a user is logged in then these statements will be available for execution whereas if not logged in these statements are ignored.. Simple way to understand.. Login to an account. Notice how Log Out and My Account now show up on your pages. Log Off and they are no longer there =P


FILENAME_LOGIN is also the command to Login or goto the login page to login which is also defined in /public_html/shoppingcart/includes/filenames.php
(note that when a user logs in it sends the command post filename_login to send the command to login)

HEADER_TITLE_LOGIN is the text “Log In” defined in public_html/shoppingcart/includes/languages/english/header.php


<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div class="navMainSearch forward"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>

FILENAME_SHOPPING_CART is for the command “shopping_cart” to send you to the shopping cart. This is defined in
public_html/shoppingcart/includes/filenames.php