DisplayMiniCart javascript Summary to display 0 Items

General ShopSite user discussion

DisplayMiniCart javascript Summary to display 0 Items

Postby jsherk » Mon Oct 12, 2009 7:12 pm

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
jsherk
 
Posts: 41
Joined: Sun Oct 11, 2009 3:19 pm
Location: USA

Postby BFChris » Tue Oct 13, 2009 6:55 am

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
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Postby jsherk » Tue Oct 13, 2009 9:02 am

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
jsherk
 
Posts: 41
Joined: Sun Oct 11, 2009 3:19 pm
Location: USA


Return to User Forum

Who is online

Users browsing this forum: No registered users and 51 guests