Pasting Mini Cart Code Into Your Custom Page Template

If you already have a custom page template that you're using in your ShopSite Pro store, you can easily add the mini cart by just copying some code from this page and pasting it into your template. After copying in the code, you can optionally set some values to change the colors in the cart. You may want to print out these instructions so that you are not having to constantly switch windows on your screen to read them.

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.

  1. While you have this help page open in your browser, open a text editing application on your computer, such as Notepad.
  2. Select one of the four mini cart styles to use in your store (ItemCount, Subtotal, Summary, or Detail). Scroll down this page and find the text box that has the code for that style.
  3. Click once with your mouse inside the text box, then type Ctrl+A (Command-A on a Macintosh) to select all of the code in the box.
  4. Type Ctrl+C (Command-C) to copy all of the code to the clipboard.
  5. Switch to the text editing application.
  6. Type Ctrl+V (Command-V) to paste the code into the text editing application.
  7. At this point you should save the file with a file name like minicart. Since it is part of a ShopSite custom template, it does not need a file extension

ItemCount Style

Subtotal Style

Summary Style

Detail Style

2. Set Colors and Options

The default settings in the mini cart code use the page link color and a transparent background colors. 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.

  1. To change the color of the text in the mini cart, replace the [-- PAGE.LinkColor --] in this line near the top of the file with a color name in quotation marks. Not all color names are recognized, but most of the basic colors (such as red, green, blue, etc.) should work. You can also enter a hex RGB color value if you are familiar with that kind of color coding.

    [-- VAR.MiniCartTextColor PAGE.LinkColor --]

  2. The background color is set to "transparent," which means that the underlying colors will show through. To specify a color, replace the "transparent" in this line with a color name like you did for the text color. Or you can delete this line entirely and delete the pound sign at the beginning of the previous line to use the page background color.

    [-- VAR.MiniCartBackgroundColor "transparent" --]

  3. You can set the cart graphic to display or not, and you can set the color to either black or white. For these two lines, the only valid values are "yes" or "no" and "black" or "white".
  4. [-- VAR.ShowCart "yes" --] [-- VAR.MiniCartColor "black" --]

  5. By default, the mini cart display will appear on the left side of whatever space it is in. You can move the mini cart to the right side or the center if it looks better in your page layout. The only valid values in this line are "left" "right" and "center".

    [-- VAR.TextAlign "left" --]

  6. Save any changes that you've made.

3. Paste the Code into Your Template

Now that you've copied the code and customized it, you're ready to paste it into your custom page template. (You may want to save it as an "include" file, which looks cleaner but has the same end result; see the next section for instructions on how to do that.)

  1. In your text editing application, select all of the code by typing Ctrl+A, then copy it to the clipboard by typing Ctrl+C.
  2. Switch to the browser window containing the ShopSite back office.
  3. Click on the Merchandising icon, then click Custom Templates.
  4. Your template should be listed in the Page Templates section. Click on it once to select it, then click Edit Template.
  5. Scroll to the place in your template where you want the mini cart to appear and click once to put the insertion point there.
  6. If you want the mini cart to appear only if the merchant has enabled it, type these lines into your template:

    [-- IF MiniCart --] [-- END_IF MiniCart --]

    Then insert a blank line between those two lines and put the insertion point there.

  7. Type Ctrl+V to paste the code into the field.
  8. Click Save Changes.
  9. Publish your store.
  10. Click the My Store icon to view your store. You should see the mini cart display, and it will probably say "0 Items" or just show the "Your Shopping Cart" header.
  11. Add an item to your cart, then click the Continue Shopping button. The mini cart display should now show the updated information.

4. Saving Your Mini Cart Code as an Include File

Custom template "include" files make it easy to modularize your templates, which can result in cleaner code and reusable components. By saving your mini cart code as an include file, it will be easier to make changes to that code and your page template will be easier to read.

  1. In your text editing application, select all of the code by typing Ctrl+A, then copy it to the clipboard by typing Ctrl+C.
  2. Switch to the browser window containing the ShopSite back office.
  3. Click on the Merchandising icon, then click Custom Templates.
  4. Scroll down the page to the Include Files section.
  5. Click New Include.
  6. Type a name for the include file, such as "minicart," then click Create.
  7. Back on the Custom Templates screen, scroll down to the Include Files section.
  8. Select your new include file, then click Edit Include.
  9. On the Edit Custom Include File screen, select and delete the one line in the editing window.
  10. Type Ctrl+V to paste the code into the field.
  11. Click Save Changes.
  12. On the Custom Templates screen, select your page template and click Edit Template.
  13. Scroll to the place in your template where you want the mini cart to appear and click once to put the insertion point there.
  14. If you want the mini cart to appear only if the merchant has enabled it, type these lines into your template:

    [-- IF MiniCart --] [-- END_IF MiniCart --]

    Then insert a blank line between those two lines and put the insertion point there.

  15. Type this line (assuming that you used "minicart" as the name of your include file):
  16. [-- INCLUDE minicart PROCESS --]

  17. Click Save Changes.
  18. Publish your store.
  19. Click the My Store icon to view your store. You should see the mini cart display, and it will probably say "0 Items" or just show the "Your Shopping Cart" header.
  20. Add an item to your cart, then click the Continue Shopping button. The mini cart display should now show the updated information.

ShopSite Help and Resource Center
February 13, 2004
Give Feedback

© 2007, ShopSite, Inc.
ShopSite Shopping Cart Software