diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index 0e6227c32..d6d8559fb 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -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'); diff --git a/lib/WebGUI/Help/Asset_Product.pm b/lib/WebGUI/Help/Asset_Product.pm index 1129bc7a9..6fbb9e837 100644 --- a/lib/WebGUI/Help/Asset_Product.pm +++ b/lib/WebGUI/Help/Asset_Product.pm @@ -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' }, diff --git a/lib/WebGUI/i18n/English/Asset_Product.pm b/lib/WebGUI/i18n/English/Asset_Product.pm index d73a92167..58dd37023 100644 --- a/lib/WebGUI/i18n/English/Asset_Product.pm +++ b/lib/WebGUI/i18n/English/Asset_Product.pm @@ -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,