www.uburst.com www.uburst.com

"Blocking Empty Carts"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

General Questions
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Blocking Empty Carts"
Posted by James on Feb-21-02 at 08:40 AM (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

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: Blocking Empty Carts, Bill Weiner, Feb-22-02, (1)
Re: Blocking Carts, James, Feb-25-02, (2)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Blocking Empty Carts"
Posted by Bill Weiner on Feb-22-02 at 05:40 AM (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

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "Re: Blocking Carts"
Posted by James on Feb-25-02 at 12:13 PM (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

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.