Announcement

Collapse
No announcement yet.

One click clear cart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    One click clear cart

    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

    #2
    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
    Code:
    	#
    	# Unsupported ACTION???
    	# Bomb out with an error message
    	#
    and just above these lines insert the following code
    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 like
    Code:
    http://localhost/cgi-bin/cm000001.pl?ACTION=EMPTYCART
    would 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.
    Zoltan
    Actinic Software
    www.actinic.co.uk

    Comment


      #3
      Will give it a whirl.

      Many thanks......

      Comment

      Working...
      X