provide a template var that will tell the user when there are no available variants for sale. Out of stock

This commit is contained in:
Colin Kuskie 2008-06-06 21:16:52 +00:00
parent 0a35d8e6c9
commit bff85b56d0
3 changed files with 24 additions and 1 deletions

View file

@ -1554,6 +1554,11 @@ sub view {
},
);
$var{buy_button} = WebGUI::Form::submit($session, { value => $i18n->get('add to cart') } );
$var{inStock} = 1;
}
else {
$var{in_stock} = 0;
$var{no_stock_message} = $i18n->get('out of stock');
}
if ($self->canEdit) {
$var{'addvariant_url'} = $self->getUrl('func=editVariant');

View file

@ -55,6 +55,8 @@ our $HELP = {
{ 'name' => 'variant_quantity' },
]
},
{ 'name' => 'in_stock' },
{ 'name' => 'no_stock_message' },
{ 'name' => 'buy_form_header' },
{ 'name' => 'buy_form_options' },
{ 'name' => 'buy_form_button' },

View file

@ -765,7 +765,7 @@ be useful, others may not.|,
},
'buy_form_options' => {
message => q|A dropdown list of available variants for this product.|,
message => q|A dropdown list of available variants for this product. Only products with a quantity greater than zero are listed.|,
lastUpdated => 1210611784,
},
@ -779,6 +779,22 @@ be useful, others may not.|,
lastUpdated => 1210611784,
},
'in_stock' => {
message => q|A boolean which says whether or not there are available variants of this product for sale|,
lastUpdated => 1212787075,
},
'no_stock_message' => {
message => q|An internationalized message saying that there are no variants of this product available for sale.|,
lastUpdated => 1210611784,
},
'out of stock' => {
message => q|Out of stock|,
lastUpdated => 1210611784,
context => q|Message displayed to the user when there is no inventory available for sale for a product.|,
},
'options' => {
message => q|Options|,
lastUpdated => 1211168603,