Fix a typo with inStock vs in_stock template variables for the Product. It should be in_stock.

Add a new template variable, canEdit.
Change the default template to use canEdit to display the list of variants, so they aren't showed
twice.
This commit is contained in:
Colin Kuskie 2008-06-19 19:59:33 +00:00
parent f2679ae07e
commit 085f521225
5 changed files with 11 additions and 2 deletions

View file

@ -22,6 +22,7 @@
- fixed: Cannot embed YouTube videos in IE6/7. Fixed by adding an "Allow Media" - fixed: Cannot embed YouTube videos in IE6/7. Fixed by adding an "Allow Media"
switch to the RichEdit asset. switch to the RichEdit asset.
- added: Next and Previous GalleryAlbum links in the GalleryAlbum views - added: Next and Previous GalleryAlbum links in the GalleryAlbum views
- fixed: Shop: Variants in dropdown and on page
7.5.12 7.5.12
- skipping this release - skipping this release

Binary file not shown.

View file

@ -1547,8 +1547,8 @@ sub view {
value => [0], value => [0],
}, },
); );
$var{buy_button} = WebGUI::Form::submit($session, { value => $i18n->get('add to cart') } ); $var{buy_button} = WebGUI::Form::submit($session, { value => $i18n->get('add to cart') } );
$var{inStock} = 1; $var{in_stock} = 1;
} }
else { else {
$var{in_stock} = 0; $var{in_stock} = 0;
@ -1558,6 +1558,7 @@ sub view {
if ($self->canEdit) { if ($self->canEdit) {
$var{'addvariant_url'} = $self->getUrl('func=editVariant'); $var{'addvariant_url'} = $self->getUrl('func=editVariant');
$var{'addvariant_label'} = $i18n->get('add a variant'); $var{'addvariant_label'} = $i18n->get('add a variant');
$var{'canEdit'} = 1;
} }
$var{variant_loop} = \@variantLoop; $var{variant_loop} = \@variantLoop;
$var{hasAddedToCart} = $self->{_hasAddedToCart}; $var{hasAddedToCart} = $self->{_hasAddedToCart};

View file

@ -18,6 +18,7 @@ our $HELP = {
], ],
fields => [], fields => [],
variables => [ variables => [
{ 'name' => 'canEdit' },
{ 'name' => 'brochure_icon' }, { 'name' => 'brochure_icon' },
{ 'name' => 'brochure_url' }, { 'name' => 'brochure_url' },
{ 'name' => 'brochure_label' }, { 'name' => 'brochure_label' },

View file

@ -829,6 +829,12 @@ be useful, others may not.|,
context => q|template variable| context => q|template variable|
}, },
'canEdit' => {
message => q|A boolean that is true if the user can edit this Product.|,
lastUpdated => 0,
context => q|template variable|
},
}; };
1; 1;