uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
Blocking Empty Carts

Knowledge Base Lobby : uShop Support Conference : General Questions
Nov-21-17 04:27 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,
James
E-MAIL AUTHOR | TABLE OF CONTENTS

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.");
}
}
< /SCRIPT >

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:

< BODY BGCOLOR="#FFFFFF" >

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" >
< /APPLET >


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:

http://www.uburst.com/uShop/applets.html

Or the uShop Programmer's Guide:

http://www.uburst.com/uShop/reference/programmers_guide.html
TABLE OF CONTENTS
                 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.

ushop/classes/template_cart.html

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,
James
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.