One of the easiest ways to add the mini cart to your ShopSite Pro store is to copy one of the examples on this page and paste it into the Page Header or Footer for your store. In addition to a simple copy and paste, you will need to:
The instructions on this page will walk you through these steps. You may want to print out these instructions so that you are not having to constantly switch windows on your screen to read them.
Note: The MiniCart uses a cookie set by the shopping cart. In order for the MiniCart to work on a store page, the shopper must have cookies enabled, and the shopping cart domain must be the same as the store page domain.
1. Copy and Paste the Code
In this step, you select a mini cart style and copy and paste the code for that style into a text editor.
<script type="text/javascript"> /**** REPLACE THE VALUES IN THESE LINES ****/ var serialnum="0000007011"; var cartURL="http://win2k/70/sc/order.cgi?storeid=*1a484557c5eb4b795d9463eed85a11&function=show"; var textColor="black"; var backgroundColor="transparent"; var showCart="yes"; // only "yes" or "no" var cartColor="black"; // only "black" or "white" var textAlign="left"; // only "left" "right" or "center" /**** DON'T CHANGE ANYTHING BELOW HERE ****/ var linkColor=textColor; var cookies=document.cookie; //read in all cookies var start = cookies.indexOf("ss_cart_" + serialnum + "="); var cartvalues = ""; var linecount = 0; var start1; var end1; var tmp; // Start Output if (showCart == "yes") { document.write("<a href=\""); document.write(cartURL + "\""); document.write(">"); document.write("<img src=\"./media/themesmedia/cart-" + cartColor + ".gif\" border=\"0\" align=\"top\">"); document.write("</a> "); } if (start == -1) //No cart cookie { document.write("<a href=\"" + cartURL + "\" style=\"color:" + linkColor + "\">"); document.write("0 Items"); document.write("</a> "); } else //cart cookie is present { start = cookies.indexOf("=", start) +1; var end = cookies.indexOf(";", start); if (end == -1) { end = cookies.length; } cartvalues = unescape(cookies.substring(start,end)); //read in just the cookie data start = 0; while ((start = cartvalues.indexOf("|", start)) != -1) { start++; end = cartvalues.indexOf("|", start); if (end != -1) { linecount++; if (linecount == 2) // Total Quantity of Items { tmp = cartvalues.substring(start,end); colon = tmp.indexOf(":", 0); document.write(""); document.write(tmp.substring(colon+1,end - start)); if ((tmp.substring(colon+1,end - start)) == 1 ) { document.write(" Item"); } else { document.write(" Items"); } document.write(": "); } if (linecount == 3) // Product Subtotal { tmp = cartvalues.substring(start,end); colon = tmp.indexOf(":", 0); document.write(tmp.substring(colon+1,end - start)); document.write(""); } start = end; } else break; } } // end while loop </script>
<script type="text/javascript"> /**** REPLACE THE VALUES IN THESE LINES ****/ var serialnum="0000007011"; var cartURL="http://win2k/70/sc/order.cgi?storeid=*1a484557c5eb4b795d9463eed85a11&function=show"; var textColor="black"; var backgroundColor="transparent"; var showCart="no"; // only "yes" or "no" var cartColor="black"; // only "black" or "white" var textAlign="left"; // only "left" "right" or "center" /**** DON'T CHANGE ANYTHING BELOW HERE ****/ var linkColor=textColor; var cookies=document.cookie; //read in all cookies var start = cookies.indexOf("ss_cart_" + serialnum + "="); var cartvalues = ""; var linecount = 0; var start1; var end1; var tmp; // Start Output if (showCart == "yes") { document.write("<a href=\""); document.write(cartURL + "\""); document.write(">"); document.write("<img src=\"./media/themesmedia/cart-" + cartColor + ".gif\" border=\"0\" align=\"top\">"); document.write("</a> "); } document.write("<a href=\"" + cartURL + "\" style=\"color:" + linkColor + "\">"); document.write("Your Shopping Cart"); document.write("</a>"); if (start == -1) //No cart cookie { } else //cart cookie is present { start = cookies.indexOf("=", start) +1; var end = cookies.indexOf(";", start); if (end == -1) { end = cookies.length; } cartvalues = unescape(cookies.substring(start,end)); //read in just the cookie data start = 0; while ((start = cartvalues.indexOf("|", start)) != -1) { start++; end = cartvalues.indexOf("|", start); if (end != -1) { linecount++; if (linecount == 2) // Total Quantity of Items { tmp = cartvalues.substring(start,end); colon = tmp.indexOf(":", 0); document.write("
Contains "); document.write(tmp.substring(colon+1,end - start)); document.write(""); if ((tmp.substring(colon+1,end - start)) == 1 ) { document.write(" Item"); } else { document.write(" Items"); } } if (linecount == 3) // Product Subtotal { tmp = cartvalues.substring(start,end); colon = tmp.indexOf(":", 0); document.write("
Subtotal: "); document.write(tmp.substring(colon+1,end - start)); document.write(""); } start = end; } else break; } } // end while loop </script>
2. Put In Your Store's Serial Number
In this step, you will put your store's serial number into the mini cart code.
var serialnum="0000007011";
3. Put In Your Store's Shopping Cart URL
In this step, you will put the URL to your store's shopping cart into the mini cart code.
http://www.mystore.com/sc/order.cgi?storeid=*1cfd55e48574687be5b7564ac9b9547f&function=show
var cartURL="
http://www.mystore.com/sc/order.cgi?storeid=*1a484557c5eb4b795d9463eed85a11&function=show";
4. Set Colors and Options
The default settings in the mini cart code produce black text on a transparent background. The ItemCount and Subtotal layouts also display a small black graphic of a shopping cart. You can follow these steps to change these colors, or you can skip this part to use the default colors.
var textColor="black";
var backgroundColor="transparent";
var showCart="yes"; var cartColor="black";
var textAlign="right";
5. Paste the Code into Your Store
Now that you've copied the code and customized it, you're ready to paste it into the Page Header or Footer of your ShopSite store. (You may want to put the mini cart in a page field, such as Text 3; see the next section for instructions on how to do that.)
6. Make Final Adjustments and Troubleshooting
The mini cart should now be working in your store, but it may not be placed exactly where you want it or it may not look "quite right."