Attached is a brief JavaScript that will check to see if the shopper has been assigned a session ID and if not, automatically reload the page so that the shopper can buy the product with a cart ID. This script works in Netscape browsers 3.0 and above and IE browsers 3.0 and above as well. Please place this script in between the <head> tags in your documents.
<SCRIPT LANGUAGE=”JavaScript”>
<!–
if (location.pathname != “/cgi-bin/SoftCart.exe/store2/product2a.html”)
window.location=”/cgi-bin/SoftCart.exe/store2/product2a.html?E+mystore2″;
while (location.pathname != “cgi-bin/Softcart.exe/store2/products2a.html”)break// –>
</SCRIPT>
You will need to modify each of these lines to reflect the following on your site:
the CGIBinDirectory:
the example is cgi-bin
the name of the executable:
the example is SoftCart.exe
the path and name of the page that you are using this script on
(this will change from page to page):
the example is for product2a.html in the store 2 directory store2/product2a.html
the configuration file that you want to invoke
the example is mystore2
This will check to see if SoftCart is in the URL (i.e. that the shopper has a session ID). If not it will automatically reload the page but invoke SoftCart and assign them a new session ID (in effect every page will have a front door link built into it).
If the shopper does have a session ID then nothing happens and the shopper continues shopping. The page does not reload and everything is fine.