Skip to content
Permalink
Browse files

Migrate CartItem from Class::InsideOut to Moose.

  • Loading branch information...
perlDreamer committed Aug 5, 2010
1 parent 679c467 commit be42b7118c0ded136738290bdcc61e0bcf6d2a42
Showing with 166 additions and 136 deletions.
  1. +8 −0 docs/migration.txt
  2. +3 −1 lib/WebGUI/Shop/Cart.pm
  3. +153 −134 lib/WebGUI/Shop/CartItem.pm
  4. +2 −1 t/Shop/ShipDriver/FlatRate.t
@@ -221,3 +221,11 @@ WebGUI::Shop::TransactionItem
Object properties are no longer written to the database when an object is created from scratch. The write method needs
to be called.

WebGUI::Shop::CartItem
=============================
Object properties are no longer written to the database when an object is created from scratch. The write method needs
to be called.

Inventory adjust is also no longer done when an object is created from scratch. You will need to call onAdjustQuantityInCart
manually.

@@ -211,7 +211,9 @@ sub addItem {
unless (defined $sku && $sku->isa("WebGUI::Asset::Sku")) {
WebGUI::Error::InvalidObject->throw(expected=>"WebGUI::Asset::Sku", got=>(ref $sku), error=>"Need a sku.");
}
my $item = WebGUI::Shop::CartItem->create( $self, $sku);
my $item = WebGUI::Shop::CartItem->new($self, $sku);
$item->write();
$sku->onAdjustQuantityInCart($item, 1);
return $item;
}

Oops, something went wrong.

0 comments on commit be42b71

Please sign in to comment.
You can’t perform that action at this time.