Do provide final cart when no pending cart was ever shown...

This commit is contained in:
Juerd Waalboer 2019-11-06 06:13:18 +01:00
parent f4eb91a22b
commit bb8c52b593
3 changed files with 6 additions and 3 deletions

View file

@ -147,7 +147,6 @@ sub user {
croak "User can only be set once" if defined $self->{user};
$self->{user} = $new;
$self->attribute('changed', 1);
$_->{description} =~ s/\$you/$new/g for $self, @{ $self->{contras} };
}

View file

@ -24,6 +24,10 @@ sub command :Tab(list,ls,shame,USERS) {
sub hook_checkout {
my ($class, $cart, $user, $transaction_id) = @_;
if ($cart->changed) {
say "Done:";
$cart->display;
}
say "Transaction ID: $transaction_id";
}

View file

@ -127,8 +127,8 @@ call_hooks("startup");
OUTER: for (;;) {
print "\n" if not @words;
if (not @words and $cart->changed) {
call_hooks("cart_changed", $cart);
if (not @words) {
call_hooks("cart_changed", $cart) if $cart->changed;
}
my $split_input = 1;