From 05544439b97cdb3818cf426f7a7c7cd5450dbfff Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Thu, 28 Feb 2013 13:56:59 +0100 Subject: [PATCH] New command: 'cash' to fake a checkout without any user paying for it. --- plugins/stock | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/stock b/plugins/stock index 5e4fa8f..4cd4c64 100644 --- a/plugins/stock +++ b/plugins/stock @@ -1,6 +1,17 @@ #!perl -sub command { NEXT } +HELP "cash" => "Checkout without a user account"; + +sub command { + my ($self, $cart, $command) = @_; + + return NEXT if $command ne 'cash'; + + call_hooks("checkout", $cart, 'cash', 0); # Fake checkout + $cart->empty; + + return ACCEPT; +} sub hook_checkout { my ($class, $cart, $user, $transaction_id) = @_;