Four ShopSite themes -- Rounded, Tab, Sidebar, and Stained Glass -- are built with custom templates, and use custom template "include" files to display the mini cart in ShopSite Pro stores. You can insert a few lines into your own custom page template to include the same files and put the mini cart on your own store pages. Because the custom template code for the mini cart already exists as "include" files, adding the mini cart is a simple process:
The mini cart display uses the values of four variables to set colors. You'll need to set these variables near the top of your page template, above the [-- INCLUDE --] tags in the following sections. Here is the list of variables with suggested settings:
[-- VAR.MiniCartColor "black" --] [-- VAR.MiniCartTextColor Page.LinkColor --] [-- VAR.MiniCartHoverColor Page.ActiveLinkColor --] [-- VAR.Media media/themesmedia --]
JavaScript functions are best defined in the <head> section of an HTML page, so place this code in that part of your page template:
[-- IF MiniCart --] [-- INCLUDE MiniCart.js PROCESS --] [-- END_IF --]
The IF tag is optional and tests for whether the merchant has enabled the mini cart. If not, the JavaScript is not added to the page, which helps keep pages from being needlessly large.
The HTML for the mini cart uses a CSS style sheet to format the display. You can use an [-- INCLUDE --] tag to add the style sheet to your template, like this:
[-- IF MiniCart --] <style type="text/css"> [-- INCLUDE Sidebar-MiniCart.css PROCESS --] </style> [-- END_IF --]
This tag brings in the mini cart style sheet used by the Sidebar theme. You can experiment with the style sheets for the other themes to see which one gives the best results in your page layout. These are the valid INCLUDE statements, but only use one:
All that's left to do is adding the tag to actually display the mini cart. Scroll down in your template and find the location where you want the mini cart displayed. You may want to add a table cell or some other HTML structure to define the location. Once you find the spot, add these lines:
[-- IF MiniCart --] <script LANGUAGE="javascript"> DisplayMiniCart("ss_cart_[-- STORE_Serial_Number --]","Subtotal"); </script> [-- END_IF --]
This little script calls the main JavaScript function to display the mini cart. Notice the word "Subtotal" at the end of the line -- that tells the JavaScript which mini cart style to display. You can change the style just by changing that word to any of the four display styles, but be careful to use the correct capitalization:
Save the changes to your template. If you were editing the template as a file on your computer, upload it to ShopSite. Regenerate your store and then view your store to see how the mini cart looks. You can make minor changes by changing the variable definitions for colors, or by including a different CSS file, or by trying a different mini cart display style. If you want to have greater control over the mini cart, you can copy and customize the include files.
ShopSite Help and Resource Center February 13, 2004 Give Feedback |
ShopSite Shopping Cart Software |