URL: http://www.uburst.com/cgi-bin/dcforum/dcboard.cgi
Forum: ushop_place_order
Thread Number: 166
[ Go back to previous page ]

Original Message
"Shopping Cart - Doesn't clear on purchase"

Posted by Chris Freeman [chris@k97.co.uk] on at 07:47 AM
After processing an order and you return to the store the cart still has all the same contents as before?

Table of contents

Messages in this discussion
"RE: Shopping Cart - Doesn't clear on purchase"
Posted by Bill Weiner on at 05:37 AM
There are only three ways to clear the cart:

1) The customer exits his/her browser (which is typically done after an order is placed.)

2) The customer uses the "Remove" button or the Delete key on the uShopCart applet to remove items.

or

3) You implement a JavaScript that utilizes uShop's clearCart() function call clear the cart after an order is placed.

To implement option 3, here are some steps:

STEP 1) First choose an HTML page that the customer will typically go to after an order is placed (like the page you link customers to after they place an order.)

STEP 2) On that HTML page, add the following JavaScript somewhere ABOVE the < BODY > line:

< SCRIPT LANGUAGE="Javascript" >
function clearCustomersCart()
{
document.uShopJSI.clearCart();
}
< /SCRIPT >

STEP 3) On that HTML page, add an "onLoad" function call to the < BODY > line, for example:

< BODY BGCOLOR="#FFFFFF" TEXT="#000000" onLoad="clearCustomersCart();" >

Note how the onLoad function calls the new clearCustomersCart() function that was created/added in Step 2.

STEP 4) Also on that HTML page, be sure to add the uShopJSI applet. This applet is typically added to the very bottom of the HTML page... just BEFORE the closing < /BODY > line:

< applet code="uShopJSI.class" codebase="../classes/" name="uShopJSI" width="2" height="2" >
< /applet >

Refer to the uShop Programmer's guide for more information about using JavaScripts with uShop:

http://www.uburst.com/uShop/reference/programmers_guide.html


"Thank you"
Posted by Chris Freeman [chris@k97.co.uk] on at 01:37 PM
Your help is greatly appreciated, I've always be a forum doubter but you have really helped really quickly I appreciate your time.

Regards,

Chris