uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Tech Support
       Support Policy
       Knowledge Base
       Reference Sites
       Software Piracy
       Legal Notices
       Privacy Policy
       Reseller Info
       Contact Us
       Site Map
Blocking Empty Carts

Knowledge Base Lobby : uShop Support Conference : General Questions
Jul-19-18 01:11 PM EST
Original Message
Blocking Empty Carts
Author James on 02-21-2002 at 08:40 (EST)
I have found that some people will go completely through an order process and pay shipping for an empty cart. This happens on occassions. Is there a way to block, not letting the customers go through to checkout if the cart is empty?

Thanks again,

Table Of Contents
  RE: Blocking Empty Carts Bill Weiner, 2002-02-22 05:40:51 (1)
            Re: Blocking Carts James, 2002-02-25 12:13:57 (2)

Messages In This Discussion
         1. RE: Blocking Empty Carts
        Author Bill Weiner on 02-22-2002 at 05:40 (EST)
Here is a trick to use uShop's JavaScript API to make sure the cart is not empty:

STEP 1: On your "begin order process" page (or whatever page(s) that you have the "uShopOrderButton" applet on) ... try adding the following JavaScript function:

< SCRIPT LANGUAGE="Javascript" >
function checkQuantity()
var itemCount = document.uShopJSI.getTotalQuantity();
if (itemCount == 0)
alert("Your shopping cart is empty.");

You can put that script pretty much anywhere on the page (it won't be visible).

STEP 2: Also on that page, modify the "BODY" line of the page to call the new JavaScript function via the "onLoad" action.

For example, if your "BODY" line of your HTML page is:


Then change it to:

< BODY BGCOLOR="#FFFFFF" onLoad="checkQuantity;" >

STEP 3: And finally, on that page, don't forget to add the special "uShopJSI" applet so that the JavaScript can interface with uShop. The uShopJSI applet can usually put at the very bottom of your page with the following HTML:

< APPLET CODE="uShopJSI.class" CODEBASE="../classes/" NAME="uShopJSI" WIDTH="2" HEIGHT="2" >

NOTE: If you have any questions about using the uShopJSI applet with uShop or with just interfacing JavaScript with uShop, please refer to the "JavaScript Examples" in the uShop Applet Reference:

Or the uShop Programmer's Guide:
                 2. Re: Blocking Carts
                Author James on 02-25-2002 at 12:13 (EST)
Thanks, I edited the template, which seems to be the best file for this mod.


I put the javascript in the header, the onload in the body tag and then at the footer / closing body tag the uShopJSI.class. Don't forget to remove the codebase within the class tag as it is in the same directory.

Works great, should be a standard.

Thanks again, great support,

© 2003 Microburst Technologies, Inc.