Moving the home page to the root directory

Assumptions

This document contains information about how to move the page home.asp to the root directory of your Web site so that your Web site home page can be your ProductCart v3 home page. The following assumptions are used in this section:

  • The “productcart” directory has not been renamed. If you have renamed it, no problem. Just adjust the links accordingly.
  • The “productcart” directory is in the root. That is, the file home.asp is two levels down from the root and will be moved two levels up. If this is not the case, change some of the links mentioned below so that they are consistent with your directory structure.

An example: You can see an example of the home page moved up 2 levels and renamed “index.asp” here:

Limitations

None. The earlier implementation restricted the use of the AJAX product preview. This new implementation, developed by GreyBeard Design Group removes that limitation.

Task List

The following is a list of tasks to be performed. Please make sure you follow these instructions carefully. Place also note that Early Impact does not provide technical support on implementing these code changes.

Move "header.asp" and "footer.asp"

Open “footer.asp” with your HTML editor and save it to the root directory (again, here we are assuming that the root is 2 levels up). The HTML editor will likely recalculate all links automatically for you (e.g. in Dreamweaver, answer yes to the “Update Links?” question).

Do the same with “header.asp”. If you have any images referenced in JavaScript code, the HTML editor will typically not edit those links. Make sure you manually review the code to see if there are any file locations that need to be updated.

Static Navigation

If you are using the “Generate Navigation” feature in the Control Panel, and therefore “header.asp” uses the file “inc_catsmenu.asp”, take the following steps.

  • Generate the navigation in the Control Panel using Absolute Links
  • Download the files “inc_catsmenu.asp”, “inc_RetailCatMenu.inc”, and “inc_WholeSaleCatMenu.inc” to your desktop
  • Open each file with your HTML editor and save it to the root directory
  • Edit “header.asp” so that it uses the version of “inc_catsmenu.asp” that you have moved to the root

Move and edit "home.asp"

Open “home.asp” and perform the same task. Here too, all the links will be automatically updated, but since you need to use a header and footer that are in the same directory, you will have to change those include statements back to pointing to header.asp and footer.asp in the same directory (now the root directory).

That is: after the links have been recalculated, do a search for “header.asp” in the file and remove the path that has been added to the file location (e.g. change file=“productcart/pc/header.asp” to file=“header.asp”). Do the same with the locations of the files “footer.asp” and “homeCode.asp”.

Move and edit "homeCode.asp" and related files

Open “homeCode.asp” and perform the same task. All the links will be automatically updated. This file loads a few other files to handle the display of products on the page. You will have to move those files to the root as well, and edit the statements that include them inside “homeCode.asp”. Specifically:

  • Open the file “pcShowProductP.asp”, save it two levels up, let the HTML editor recalculate links in it, and then edit “homeCode.asp” so that the previously recalculated link is edited back to point to a local file. That is: file=“productcart/pc/pcShowProductP.asp”, should be edited back to file=“pcShowProductP.asp”
  • Do the same for these files: pcShowProductH.asp, pcShowProductL.asp, pcShowProductM.asp

Some of the code that load images on these pages contains variables, and an HTML editor like Dreamweaver does not recalculate links correctly when that is the case. To fix the problem, do the following (if you are not using Dreamweaver, perform the same tasks using your HTML editor):

  1. Go to the root directory
  2. Highlight the following 5 files: homeCode.asp, pcShowProductH.asp, pcShowProductL.asp, pcShowProductM.asp, pcShowProductP.asp
  3. Right click and select 'Edit with Dreamweaver'
  4. Open the Find & Replace tool (CTRL+F); select “Open Documents” in the “Find In” menu; select “Source Code” in “Search” menu; do a find & replace on the following string:
Find: src="catalog/
Replace with: src="productcart/pc/catalog/

Find: src="<%=rslayout
Replace with: src="productcart/pc/<%=rslayout

Save the 5 files.

Edit the Small Search Box

In v3.12 and up the small search box includes additional JavaScript to control the “Pease wait… searching” dialog window. If you have either of the two small search files (“SmallSearchBox.asp” or “SmallSearchBox08.asp”) included within your header or footer you will need to make this edit. The following article explains how to Removing the "Please wait..." Dialog Window from Small Search Box from the small search box.

Additional Code Changes

homeCode.asp

There are three links that need to be manually updated:

Find: strArray(0,2)="showspecials.asp"
Replace with: strArray(0,2)="productcart/pc/showspecials.asp"

Find: strArray(1,2)="shownewarrivals.asp"
Replace with: strArray(1,2)="productcart/pc/shownewarrivals.asp"

Find: strArray(2,2)="showbestsellers.asp"
Replace with: strArray(2,2)="productcart/pc/showbestsellers.asp"

AJAX IMPLEMENTATION

Copy AJAX Images

If it does not already exist, create a folder in the root called images. Copy from the “/productcart/pc/”images folder all of the .png files related to the AJAX popup and place them in the images folder in the root of your web site:

  • topcap.png
  • titlemiddle.png
  • contentmiddle.png
  • bottomcap.png
  • pngfix.png
  • up-right-combo.png
  • up-left-combo.png
  • lower-right-combo.png
  • lower-left-combo.png

Copy AJAX Files

Copy the following files from the “/productcart/pc” folder to the root of your web site:

  • inc_PrdCatTip.asp
  • xml_getPrdInfo.asp

Edit inc_PrdCatTip.asp

  • change the tag that points to ei-tooltip.css so that it points to “productcart/store/pc/ei-tooltip.css”
  • change the tag that points to ei-tooltip.js so that it points to “productcart/store/pc/ ei-tooltip.js”
  • change the tag that points to XHConn.js so that it points to “productcart/store/pc/XHConn.js”
  • locate the following and edit to point to the “/productcart/pc” folder:

before:

  • myConn.connect(“xml_srcListPrds.asp”, “POST”, GetAllValues(document.ajaxSearch), fnWhenDone);

after:

  • myConn.connect(“productcart/pc/xml_srcListPrds.asp”, “POST”, GetAllValues(document.ajaxSearch), fnWhenDone);

Edit xml_getPrdInfo.asp

  • Around line 64 there are 11 “include” tags and 2 more further down the code.

Change all of these to point to your “productcart/includes” or “productcart/pc” folders, respectively.

  • Locate the following statement and edit it to point to the “/productcart/pc” folder:

before:

  • tmpList=tmpList & ”<img src=”“catalog/” & pSmimageURL & ””” >” & vbcrlf

after:

  • tmpList=tmpList & ”<img src=””/productcart /pc/catalog/” & pSmimageURL & ””” >” & vbcrlf

Troubleshooting

In all the links above, remember to replace “productcart” with the name of the folder used on your store, in case you have renamed the “productcart” folder.

Images are broken

Make sure you have correctly performed the find & replace mentioned above:

Find: src="catalog/
Replace with: src="productcart/pc/catalog/

Buttons are not shown

Make sure you have correctly performed the find & replace mentioned above:

Find: src="<%=rslayout
Replace with: src="productcart/pc/<%=rslayout

Personal Tools