stardust Posted March 19, 2006 Posted March 19, 2006 I made my shop, everything was ok, except for some links.Since It uses STS Template System, the custom links i created didn't work as I expected.The main prob is if a logged user clicks the link, he will logoff because it don't generate the user id.Of course, you can force the use of cookies, but in my case it wasn't the best choice. Who knows what kind of costumer will visit your shop?Will everybody understand about cookies?Does the user browser support it?Will everybody put the security levels low enough?Well, guess not, so if you want to allow all kind of costumers buy in your shop, learn here how to generate osCid on all your links on STS. *I don?t know if there is other topic about this matter, well, I searched for almost the whole month for something like this and didn?t find, but anyway... First, open these two files: /includes/languages/yourlanguage.php /includes/sts_display_output.php In sts_display_output Around line 185, you'll find something like this: // Note: These values lifted from the stock /catalog/includes/header.php script's HTML // catalogurl: url to catalog's home page // catalog: link to catalog's home page Below this is what really matter.Notice that all the "$code" you put in the HTML file are here. Generate a text link At line 204, below "if (tep_session_is_registered('customer_id')) {" insert this: $template['name_of_the_code] = '<a href=' . tep_href_link(FILENAME_NAME_OF_THE_PAGE, '', 'SSL') . ' class="class of the table">' . HEADER_TITLE_DEFINE_TEXT . '</a>'; And below line 214 (? } else {?), copy the code and paste it before line 224 Notice that: name_of_the_code, is the text you'll insert in the HTML file, where you want the link NAME_OF_THE_PAGE (always with capslock) is the page where the link will take the visitor HEADER_TITLE_ DEFINE_TEXT (always with capslock) is the definition (text) used in the language file for the link class of the table: where the link is (header, headernavigation, left, etc.).Search for them in the code of your HTML file.Those classes are used by the css file to modify the look of the text and backgrunds. Example: $template['contact] = '<a href=' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_CONTACT_US . '</a>'; Copy&Paste this code below line 214 (? } else {?) and before line 224.If the the code isn't there too, the whole thing won't work Now open the language file, around line 45, you'll see lots of this: define('HEADER_TITLE_SOMETHING', 'Text'); For the contact us exemple, insert this on the file (below the last 'define'): define('HEADER_TITLE_CONTACT_US', 'Contact us'); You may change the "Contact us" text to whatever you want, this will be the text of the link. Now, all you have to do is to insert the $contact in the HTML file, in your store, it will show "Contact us" link, and most important, with osCid, so the user won't logoff if he/she clicks it. Insert an image link Between line 188 and 203 of sts_display_output.php $template['name_of_the_$code'] = '<a href="' . tep_href_link(FILENAME_NAME_OF_THE_PAGE, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'image.kind', HEADER_TITLE_NAME_OF_THE_PAGE) . '</a>'; This one is more simple, you don't have to copy and paste anywhere else, but you can't place the code after the line " if (tep_session_is_registered('customer_id')) {", insert it before ok? A fast example: $template['faqlogo'] = '<a href="' . tep_href_link(FILENAME_FAQ, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'faq.jpg', HEADER_TITLE_FAQ) . '</a>'; Put only the name of the image AND the format (.jpg/.gif or whatever), the script will search it inside the 'image' folder, so just put the image there. At the HEADER_TITLE part, just repeat the name of the page, whatever you put here won't appear on the image link, or any other part. That's all! NOTE If you want to create an image link for the "home" page, the code is this: $template['code_name'] = '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'image.kind', '') . '</a>'; Some STS come with it, while others not, so, if you already have it (usually at line 188) just edit it to your needs. Now, you have an image link with osCid ;) Thanks for reading, hope this helps and forgive my poor english =)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.