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:
parent
f2679ae07e
commit
085f521225
5 changed files with 11 additions and 2 deletions
|
|
@ -1547,8 +1547,8 @@ sub view {
|
|||
value => [0],
|
||||
},
|
||||
);
|
||||
$var{buy_button} = WebGUI::Form::submit($session, { value => $i18n->get('add to cart') } );
|
||||
$var{inStock} = 1;
|
||||
$var{buy_button} = WebGUI::Form::submit($session, { value => $i18n->get('add to cart') } );
|
||||
$var{in_stock} = 1;
|
||||
}
|
||||
else {
|
||||
$var{in_stock} = 0;
|
||||
|
|
@ -1558,6 +1558,7 @@ sub view {
|
|||
if ($self->canEdit) {
|
||||
$var{'addvariant_url'} = $self->getUrl('func=editVariant');
|
||||
$var{'addvariant_label'} = $i18n->get('add a variant');
|
||||
$var{'canEdit'} = 1;
|
||||
}
|
||||
$var{variant_loop} = \@variantLoop;
|
||||
$var{hasAddedToCart} = $self->{_hasAddedToCart};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue