englishchrissy Posted March 26, 2006 Posted March 26, 2006 Hi Guys, are there any instructions available how to set up a Home page. If you click the 'Top' menu item on the navbar it takes you to the index page in your document root which in my case is the Apache page on my localhost. I know you can change this to any page you want but you have to be careful about preserving session id's etc. Others must have had this problem so any advice would be most helpful. Basically what I want is a home page before you go into the catalog. Thanks for your time. Webmaster www.SexoticToys.co.uk
ozcsys Posted March 26, 2006 Posted March 26, 2006 Hi Guys, are there any instructions available how to set up a Home page. If you click the 'Top' menu item on the navbar it takes you to the index page in your document root which in my case is the Apache page on my localhost. I know you can change this to any page you want but you have to be careful about preserving session id's etc. Others must have had this problem so any advice would be most helpful. Basically what I want is a home page before you go into the catalog. Thanks for your time. Create a index.html page and upload it to the root folder of your site and that is where top will send you. The Knowledge Base is a wonderful thing. Do you have a problem? Have you checked out Common Problems? There are many very useful osC Contributions Are you having trouble with a installed contribution? Have you checked out the support thread found Here BACKUP BACKUP BACKUP!!! You did backup, right??
englishchrissy Posted March 26, 2006 Author Posted March 26, 2006 Create a index.html page and upload it to the root folder of your site and that is where top will send you. Thanks. Its as simple as that. Cheers. Webmaster www.SexoticToys.co.uk
Guest Posted March 26, 2006 Posted March 26, 2006 Create a index.html page and upload it to the root folder of your site and that is where top will send you. you do this and you lose your sessions. If you click the 'Top' menu item on the navbar it takes you to the index page in your document root which in my case is the Apache page on my localhost. I know you can change this to any page you want but you have to be careful about preserving session id's etc. Others must have had this problem so any advice would be most helpful. Basically what I want is a home page before you go into the catalog. Create another php page which will become your site's root page. Change the catalog\includes\filenames.php so FILENAME_DEFAULT will not point to index.php but say to index2.php. Rename your current catalog\index.php to catalog\index2.php . Now rename the new page you created to index.php add an extra definition into your filenames.php for it. If you want to have the osc catalog in a separate folder than the site root then you will need something like the external sessions contribution
ozcsys Posted March 26, 2006 Posted March 26, 2006 you do this and you lose your sessions. Create another php page which will become your site's root page. Change the catalog\includes\filenames.php so FILENAME_DEFAULT will not point to index.php but say to index2.php. Rename your current catalog\index.php to catalog\index2.php . Now rename the new page you created to index.php add an extra definition into your filenames.php for it. If you want to have the osc catalog in a separate folder than the site root then you will need something like the external sessions contribution Interesting as I have a few sites that have html pages in the root with osC being setup in a /catalog folder and I can go from the html pages back to the osC pages via the Home(top) link and links to osC from the index.html page and not lose the sessions info. Add something to the cart and it stays in the cart login and you stay logged in and I have never had any issues.. The Knowledge Base is a wonderful thing. Do you have a problem? Have you checked out Common Problems? There are many very useful osC Contributions Are you having trouble with a installed contribution? Have you checked out the support thread found Here BACKUP BACKUP BACKUP!!! You did backup, right??
Guest Posted March 26, 2006 Posted March 26, 2006 Interesting as I have a few sites that have html pages in the root with osC being setup in a /catalog folder and I can go from the html pages back to the osC pages via the Home(top) link and links to osC from the index.html page and not lose the sessions info. Add something to the cart and it stays in the cart login and you stay logged in and I have never had any issues.. is it because you rely solely on cookies? If you block them you will see the problem.
englishchrissy Posted March 30, 2006 Author Posted March 30, 2006 Thanks Enigma1, I'm nearly there. How do I change the links in the nav bar at the top of the page to point to the right pages? Cheers Webmaster www.SexoticToys.co.uk
Guest Posted March 30, 2006 Posted March 30, 2006 if you're refering to the breadcrumb it is in the includes\application_top.php You will see something like $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); These point to the root of the catalog. So you use the second definition you have (not sure how you named it) and then you will have something like $breadcrumb->add('The Root', tep_href_link(FILENAME_DEFAULT)); $breadcrumb->add('The Store', tep_href_link(FILENAME_DEFAULT2)); And for internal links to your osc store use always the tep_href_link function to maintain the sessions.
englishchrissy Posted March 31, 2006 Author Posted March 31, 2006 Great! Thanks for pointing me in the right direction Enigma1. This is how I eventually accomplished my Home page. Giving it the file extension .phtml wont give me any problems when I upload to a live server, will it? I will just have to make sure that my hosting company changes their Apache httpd.conf file. Hope this helps anyone else in the community to set up a Home page for oscommerce store. To add a home page to oscommerce catalog. FIRST BACKUP, BACKUP AND AGAIN BACKUP!!!!! 1.Create new page from existing page. I used login.php as its quite bare. Name it index.phtml and deleted all the 'login' stuff that I dont require on the Home page. 2.Change C:\Apache2\conf\httpd.conf to include the file extension .phtml as follows:- LoadModule php5_module c:/php5/php5apache2.dll AddType application/x-httpd-php .php .phtml 3.Add the name of your home page to filenames.php define('FILENAME_HOME', 'index.phtml'); 4.Change /catalog/includes/application_top.php so that the breadcrumb trail link in the nav bar (breadcrumb trail bar) corresponds to your new page:- From $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER); $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); To // If statement below added for Home page. by chrissy if (basename($PHP_SELF) == FILENAME_HOME) { $breadcrumb->add(HEADER_TITLE_TOP, tep_href_link(FILENAME_HOME)); } else { $breadcrumb->add(HEADER_TITLE_TOP, tep_href_link(FILENAME_HOME)); $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); } 5.Now you need a link to your Catalog page as there isnt one on the new Home page. I did this by adding it to the nav bar. The grey bar showing the breadcrumb trail. I also added a link to 'log in' so that you can log in straight from the home page. Note. when you are logged in the link now says 'Log off'. So change /catalog/includes/header.php line 64 (the line that sets up 'My Account', 'Cart Contents' and 'Checkout' links to:- <!-- Added 'Shop' and 'Log In' to available links on this nav bar. chrissy //--> <td align="right" class="headerNavigation"><a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CATALOG; ?></a> ?|? <?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> ?|? <?php } else { ?><a href="<?php echo tep_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a> ?|? <?php }?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> ?|? <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> ?|? <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> ??</td> NOW TEST, TEST AND TEST!!!!! 6.So now all I have to do is make my new Home page nice and pretty and functional. Hope this helps the community. And thanks again Enigma1. Webmaster www.SexoticToys.co.uk
Recommended Posts
Archived
This topic is now archived and is closed to further replies.