changed the name of getCartBySession to newBySession

created the CartItemCount and MiniCart macros
added help for MinCart, Cart, Address Book, and Edit Address templates
This commit is contained in:
JT Smith 2008-05-24 23:27:30 +00:00
parent e3061a1606
commit 57c85fde5a
18 changed files with 895 additions and 43 deletions

View file

@ -169,7 +169,7 @@ Returns a reference to the current session's cart.
sub getCart {
my $self = shift;
return WebGUI::Shop::Cart->getCartBySession($self->session);
return WebGUI::Shop::Cart->newBySession($self->session);
}
#-------------------------------------------------------------------

View file

@ -1448,7 +1448,7 @@ sub view {
'variant_controls' => $segment,
'variant_sku' => $collateral->{varSku},
'variant_title' => $collateral->{shortdesc},
'variant_price' => $collateral->{price},
'variant_price' => sprintf("%.2f", $collateral->{price}),
'variant_weight' => $collateral->{weight},
'variant_quantity' => $collateral->{quantity},
});

View file

@ -411,7 +411,7 @@ sub www_buildBadge {
manageEventMetaFieldsUrl => $self->getUrl('func=manageEventMetaFields'),
);
my @otherBadges =();
my $cart = WebGUI::Shop::Cart->getCartBySession($session);
my $cart = WebGUI::Shop::Cart->newBySession($session);
foreach my $item (@{$cart->getItems}) {
my $id = $item->get('options')->{badgeId};
next if ($id eq $badgeId);
@ -755,7 +755,7 @@ sub www_getRegistrantAsJson {
}
# see what's in the cart
my $cart = WebGUI::Shop::Cart->getCartBySession($session);
my $cart = WebGUI::Shop::Cart->newBySession($session);
foreach my $item (@{$cart->getItems}) {
# not related to this badge, so skip it
next unless $item->get('options')->{badgeId} eq $badgeId;
@ -1478,7 +1478,7 @@ sub www_removeItemFromBadge {
my $session = $self->session;
return $session->privilege->insufficient() unless $self->canView;
my $form = $session->form;
my $cart = WebGUI::Shop::Cart->getCartBySession($session);
my $cart = WebGUI::Shop::Cart->newBySession($session);
my $item = $cart->getItem($form->get('itemId'));
$item->remove;
return $self->www_getRegistrantAsJson();