Can no longer buy badges from receipt or direct link page if quantity is empty
This commit is contained in:
parent
4c85377156
commit
c678529589
3 changed files with 13 additions and 1 deletions
|
|
@ -51,6 +51,9 @@ Adds this badge as configured for an individual to the cart.
|
|||
|
||||
sub addToCart {
|
||||
my ($self, $badgeInfo) = @_;
|
||||
if($self->getQuantityAvailable() < 1){
|
||||
return WebGUI::International->new($self->session, "Asset_EventManagementSystem")->get('no more available');
|
||||
}
|
||||
$badgeInfo->{badgeId} = "new";
|
||||
$badgeInfo->{badgeAssetId} = $self->getId;
|
||||
$badgeInfo->{emsAssetId} = $self->getParent->getId;
|
||||
|
|
@ -397,7 +400,9 @@ sub view {
|
|||
name => 'email',
|
||||
defaultValue => $form->get('email','email'),
|
||||
});
|
||||
$vars{submitAddress} = WebGUI::Form::submit($session, {value => $i18n->get('add to cart'),});
|
||||
if($self->getQuantityAvailable() > 0){
|
||||
$vars{submitAddress} = WebGUI::Form::submit($session, {value => $i18n->get('add to cart'),});
|
||||
}
|
||||
$vars{title} = $self->getTitle;
|
||||
$vars{description} = $self->get('description');
|
||||
|
||||
|
|
|
|||
|
|
@ -895,6 +895,11 @@ our $I18N = {
|
|||
context => q|heading on add badge to cart screen|,
|
||||
},
|
||||
|
||||
'no more available' => {
|
||||
message => q|Error: No more items available for purcahse.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'add to cart' => {
|
||||
message => q|Add To Cart|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue