Skip to content

Commit 36f818e

Browse files
committedAug 30, 2011
Check for mixed items in the cart AFTER processing delete requests. Fixes bug #12239.
1 parent 7a89bf1 commit 36f818e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎docs/changelog/7.x.x.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- fixed #12195: Visitor group by scratch membership shared among all Visitors (Dale Trexel)
55
- fixed #12227: Corrected AssetReport such that OrderBy works correctly.
66
- fixed #12238: Old template attachement in search template slows down sites
7+
- fixed #12239: Still get cart error message after removing extra recurring items from the cart
78

89
7.10.22
910
- rfe #12223: Add date type to content profiling (metadata)

‎lib/WebGUI/Shop/Cart.pm

+6-5
Original file line numberDiff line numberDiff line change
@@ -758,17 +758,18 @@ sub updateFromForm {
758758
$item->update({shippingAddressId => $itemAddressId});
759759
}
760760
}
761-
if ($self->hasMixedItems) {
762-
my $i18n = WebGUI::International->new($self->session, "Shop");
763-
$error{id $self} = $i18n->get('mixed items warning');
764-
}
765-
766761
my @cartItemIds = $form->process('remove_item', 'checkList');
767762
foreach my $cartItemId (@cartItemIds) {
768763
my $item = eval { $self->getItem($cartItemId); };
769764
$item->remove if ! Exception::Class->caught();
770765
}
771766

767+
##Remove the items BEFORE we check to see if there are duplicates.
768+
if ($self->hasMixedItems) {
769+
my $i18n = WebGUI::International->new($self->session, "Shop");
770+
$error{id $self} = $i18n->get('mixed items warning');
771+
}
772+
772773
##Visitor cannot have an address book, or set a payment gateway, so skip the rest of this.
773774
return 1 if $session->user->isVisitor;
774775

0 commit comments

Comments
 (0)
Please sign in to comment.