PDA

View Full Version : One click clear cart


I-CC
14-Jul-2003, 12:39 PM
Hi all,

Anyone know of a method for emptying a cart content with one click.

I.e. image file pertaining to "Empty Cart Content". When this gets clicked it sends the Actinic scripts the correct message to empty the cart content completely, so that the customer can start from scratch again.

Any ideas or has someone maybe dome this before.

Thanks

zmagyar
14-Jul-2003, 03:41 PM
This was supported in v5 but the feature has been removed when the cart and session management was reworked in v6. This has been retired because v6 provides alternate functionality to empty the cart (tick all "Delete" checkboxes and press update). However I agree it is not exactly the same.

If you really want this feature then some customisation on CartManager.pl would do this. Open this file in a plain text editor and find the lines #
# Unsupported ACTION???
# Bomb out with an error message
#and just above these lines insert the following code elsif ($sAction eq "EMPTYCART")
{
@Response = $::Session->GetCartObject(); # get the cart object
my $pCartObject = $Response[2];
my $pCartList = $pCartObject->GetCartList(); # get the shopping cart

foreach (my $nIndex = $#$pCartList; $nIndex >= 0; $nIndex--)
{
$pCartObject->RemoveItem($nIndex); # then remove it
}
}Once this is modifed and the site uploaded then a call likehttp://localhost/cgi-bin/cm000001.pl?ACTION=EMPTYCARTwould do what is desired.

Please note that Actinic doesn't support customised scripts on any way therefore this change can only be done at your own risk.

I hope this helps.

I-CC
14-Jul-2003, 03:44 PM
Will give it a whirl.

Many thanks......