fixed several checkout bugs

This commit is contained in:
JT Smith 2008-04-08 18:48:43 +00:00
parent ca61c81967
commit 7e4e7898c0
5 changed files with 60 additions and 29 deletions

View file

@ -132,7 +132,7 @@ Does bookkeeping on EMSRegistrationRibbon table.
sub onCompletePurchase {
my ($self, $item) = @_;
$self->session->db->write("insert into EMSRegistrationRibbon (ribbonAssetId, badgeId) values (?,?)",
$self->session->db->write("insert into EMSRegistrantRibbon (ribbonAssetId, badgeId) values (?,?)",
[$self->getId, $self->getOptions->{badgeId}]);
return undef;
}

View file

@ -118,10 +118,10 @@ sub onCompletePurchase {
my $currentQuantity = $db->quickScalar("select quantity from EMSRegistrantToken where tokenAssetId=? and badgeId=?",\@params);
unshift @params, $item->get("quantity");
if (defined $currentQuantity) {
$db->write("update EMSRegistrationToken set quantity=quantity+? where tokenAssetId=? and badgeId=?",\@params);
$db->write("update EMSRegistrantToken set quantity=quantity+? where tokenAssetId=? and badgeId=?",\@params);
}
else {
$db->write("insert into EMSRegistrationToken (quantity, tokenAssetId, badgeId) values (?,?,?)",\@params);
$db->write("insert into EMSRegistrantToken (quantity, tokenAssetId, badgeId) values (?,?,?)",\@params);
}
return undef;
}