DisplayMiniCart javascript Summary to display 0 Items

General ShopSite user discussion
Post Reply
jsherk
Posts: 41
Joined: Sun Oct 11, 2009 3:19 pm
Location: USA

DisplayMiniCart javascript Summary to display 0 Items

Post by jsherk »

I am using the Clean theme, and when using the DisplayMiniCart javascript set to "Summary" it displays the following:
You Shopping Cart
Contains 3 Items
Subtotal $15.00

This is nice when there are items to display, but when there are no items, it simply displays:
You Shopping Cart

It would nice to have an option that let's you show "0 Items" instead of leaving it blank, like this:
You Shopping Cart
Contains 0 Items
BFChris
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Post by BFChris »

This is relatively simple to do.

In the mini-cart Javascript code, find the code that represents an empty cart starts with:

Code: Select all

if (start == -1)  //No cart cookie
then add the text you want to appear, like:

Code: Select all

document.write("Contains 0 Items");
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
jsherk
Posts: 41
Joined: Sun Oct 11, 2009 3:19 pm
Location: USA

Post by jsherk »

Ok BFChris...

I copied the MiniCart.js file into /shopsite-data/templates/includes/ folder and then made the following modification at line 67 (using v10 PRO):

Changed this:

Code: Select all

document.write("<\/div>\n");
To this:

Code: Select all

document.write("<br>Contains <b>0</b> [-- STORE.Items --]");
document.write("<\/div>\n");
Thanks
Post Reply