How to create a STS tag to link to a PHP file:
Look for the PHP code that links to the PHP file (or infobox, or whatever) that you want to make a tag for:
In this example, we want to make a tag for “account.php”. In the stock osc store, there is a “My Account” graphic that when it is clicked, it will open the “account.php” file. Well, we only want the URL since we will either make a text link or use our own graphic to match our template.
The stock graphic link is defined in the
includes/header.php file:
<?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) .
In the above, a graphic file "header_account.gif" is used for the link. Looking a little closer, we see the actual URL link to account.php would be:
tep_href_link(FILENAME_ACCOUNT, '', 'SSL')
So, you create the tag for the URL link to account.php as so:
$sts->template['urlmyaccountlogo'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
The
tag is defined as: $urlmyaccountlogo
We could have called it anything we wanted such as $stupidlink
We now need to save the code that we have created either in the “includes/modules/sts_inc/sts_user_code.php” or “general.php” files. Once we have done this, the tag will be ready for use in our template.
Here are some tips on where to look for code in your osCommerce store:
The header is called from the file “includes/header.php.
The left column is the file “includes/column_left.php.”
The right column is the file “includes/column_right.php”.
The footer is the file “includes/footer.php”.