Translate all Product variables to use underscores instead of dots.
Update i18n and Help and the Product Template. Remove the Benefits Showcase, Left Column Collateral and Three Columns Product templates.
This commit is contained in:
parent
5edb13924a
commit
3428c3947d
6 changed files with 230 additions and 205 deletions
|
|
@ -835,7 +835,10 @@ sub www_buy {
|
|||
my $vid = $self->session->form->process('vid');
|
||||
my $variant = $self->getCollateral('variantsJSON', 'variantId', $vid);
|
||||
return '' unless keys %{ $variant };
|
||||
$self->addToCart($variant);
|
||||
my $error = $self->addToCart($variant);
|
||||
if ($error) {
|
||||
$self->view($error);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
@ -1250,6 +1253,7 @@ sub www_moveVariantUp {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
my $error = shift;
|
||||
my $session = $self->session;
|
||||
if (!$session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
||||
|
|
@ -1269,23 +1273,23 @@ sub view {
|
|||
my $i18n = WebGUI::International->new($session,'Asset_Product');
|
||||
if ($brochure) {
|
||||
my $file = WebGUI::Storage->get($session,$brochure);
|
||||
$var{"brochure.icon"} = $self->getFileIconUrl($file);
|
||||
$var{"brochure.label"} = $i18n->get(13);
|
||||
$var{"brochure.URL"} = $self->getFileUrl($file);
|
||||
$var{"brochure_icon"} = $self->getFileIconUrl($file);
|
||||
$var{"brochure_label"} = $i18n->get(13);
|
||||
$var{"brochure_URL"} = $self->getFileUrl($file);
|
||||
}
|
||||
#---manual
|
||||
if ($manual) {
|
||||
my $file = WebGUI::Storage->get($session,$manual);
|
||||
$var{"manual.icon"} = $self->getFileIconUrl($file);
|
||||
$var{"manual.label"} = $i18n->get(14);
|
||||
$var{"manual.URL"} = $self->getFileUrl($file);
|
||||
$var{"manual_icon"} = $self->getFileIconUrl($file);
|
||||
$var{"manual_label"} = $i18n->get(14);
|
||||
$var{"manual_URL"} = $self->getFileUrl($file);
|
||||
}
|
||||
#---warranty
|
||||
if ($warranty) {
|
||||
my $file = WebGUI::Storage->get($session,$warranty);
|
||||
$var{"warranty.icon"} = $self->getFileIconUrl($file);
|
||||
$var{"warranty.label"} = $i18n->get(15);
|
||||
$var{"warranty.URL"} = $self->getFileUrl($file);
|
||||
$var{"warranty_icon"} = $self->getFileIconUrl($file);
|
||||
$var{"warranty_label"} = $i18n->get(15);
|
||||
$var{"warranty_URL"} = $self->getFileUrl($file);
|
||||
}
|
||||
#---image1
|
||||
if ($image1) {
|
||||
|
|
@ -1307,8 +1311,8 @@ sub view {
|
|||
}
|
||||
|
||||
#---features
|
||||
$var{'addFeature.url'} = $self->getUrl('func=editFeature&fid=new');
|
||||
$var{'addFeature.label'} = $i18n->get(34);
|
||||
$var{'addFeature_url'} = $self->getUrl('func=editFeature&fid=new');
|
||||
$var{'addFeature_label'} = $i18n->get(34);
|
||||
foreach my $collateral ( @{ $self->getAllCollateral('featureJSON') } ) {
|
||||
my $id = $collateral->{featureId};
|
||||
$segment = $self->session->icon->delete('func=deleteFeatureConfirm&fid='.$id,$self->get('url'),$i18n->get(3))
|
||||
|
|
@ -1316,15 +1320,15 @@ sub view {
|
|||
. $self->session->icon->moveUp('func=moveFeatureUp&fid='.$id,$self->get('url'))
|
||||
. $self->session->icon->moveDown('func=moveFeatureDown&fid='.$id,$self->get('url'));
|
||||
push(@featureloop,{
|
||||
'feature.feature' => $collateral->{feature},
|
||||
'feature.controls' => $segment
|
||||
'feature_feature' => $collateral->{feature},
|
||||
'feature_controls' => $segment
|
||||
});
|
||||
}
|
||||
$var{feature_loop} = \@featureloop;
|
||||
|
||||
#---benefits
|
||||
$var{"addBenefit.url"} = $self->getUrl('func=editBenefit&bid=new');
|
||||
$var{"addBenefit.label"} = $i18n->get(55);
|
||||
$var{"addBenefit_url"} = $self->getUrl('func=editBenefit&bid=new');
|
||||
$var{"addBenefit_label"} = $i18n->get(55);
|
||||
foreach my $collateral ( @{ $self->getAllCollateral('benefitJSON') } ) {
|
||||
my $id = $collateral->{benefitId};
|
||||
$segment = $self->session->icon->delete('func=deleteBenefitConfirm&bid='.$id,$self->get("url"),$i18n->get(48))
|
||||
|
|
@ -1332,15 +1336,15 @@ sub view {
|
|||
. $self->session->icon->moveUp('func=moveBenefitUp&bid='.$id,$self->get("url"))
|
||||
. $self->session->icon->moveDown('func=moveBenefitDown&bid='.$id,$self->get("url"));
|
||||
push(@benefitloop,{
|
||||
"benefit.benefit"=>$collateral->{benefit},
|
||||
"benefit.controls"=>$segment
|
||||
"benefit_benefit"=>$collateral->{benefit},
|
||||
"benefit_controls"=>$segment
|
||||
});
|
||||
}
|
||||
$var{benefit_loop} = \@benefitloop;
|
||||
|
||||
#---specifications
|
||||
$var{'addSpecification.url'} = $self->getUrl('func=editSpecification&sid=new');
|
||||
$var{'addSpecification.label'} = $i18n->get(35);
|
||||
$var{'addSpecification_url'} = $self->getUrl('func=editSpecification&sid=new');
|
||||
$var{'addSpecification_label'} = $i18n->get(35);
|
||||
foreach my $collateral ( @{ $self->getAllCollateral('specificationJSON') } ) {
|
||||
my $id = $collateral->{specificationId};
|
||||
$segment = $self->session->icon->delete('func=deleteSpecificationConfirm&sid='.$id,$self->get('url'),$i18n->get(5))
|
||||
|
|
@ -1348,17 +1352,17 @@ sub view {
|
|||
. $self->session->icon->moveUp('func=moveSpecificationUp&sid='.$id,$self->get('url'))
|
||||
. $self->session->icon->moveDown('func=moveSpecificationDown&sid='.$id,$self->get('url'));
|
||||
push(@specificationloop,{
|
||||
'specification.controls' => $segment,
|
||||
'specification.specification' => $collateral->{value},
|
||||
'specification.units' => $collateral->{units},
|
||||
'specification.label' => $collateral->{name},
|
||||
'specification_controls' => $segment,
|
||||
'specification_specification' => $collateral->{value},
|
||||
'specification_units' => $collateral->{units},
|
||||
'specification_label' => $collateral->{name},
|
||||
});
|
||||
}
|
||||
$var{specification_loop} = \@specificationloop;
|
||||
|
||||
#---accessories
|
||||
$var{'addaccessory.url'} = $self->getUrl('func=addAccessory');
|
||||
$var{'addaccessory.label'} = $i18n->get(36);
|
||||
$var{'addaccessory_url'} = $self->getUrl('func=addAccessory');
|
||||
$var{'addaccessory_label'} = $i18n->get(36);
|
||||
##Need an id for collateral operations, and an assetId for asset instantiation.
|
||||
foreach my $collateral ( @{ $self->getAllCollateral('accessoryJSON') } ) {
|
||||
my $id = $collateral->{accessoryAssetId};
|
||||
|
|
@ -1367,16 +1371,16 @@ sub view {
|
|||
. $self->session->icon->moveDown('func=moveAccessoryDown&aid='.$id,$self->get('url'));
|
||||
my $accessory = WebGUI::Asset->newByDynamicClass($session, $collateral->{accessoryAssetId});
|
||||
push(@accessoryloop,{
|
||||
'accessory.URL' => $accessory->getUrl,
|
||||
'accessory.title' => $accessory->getTitle,
|
||||
'accessory.controls' => $segment,
|
||||
'accessory_URL' => $accessory->getUrl,
|
||||
'accessory_title' => $accessory->getTitle,
|
||||
'accessory_controls' => $segment,
|
||||
});
|
||||
}
|
||||
$var{accessory_loop} = \@accessoryloop;
|
||||
|
||||
#---related
|
||||
$var{'addrelatedproduct.url'} = $self->getUrl('func=addRelated');
|
||||
$var{'addrelatedproduct.label'} = $i18n->get(37);
|
||||
$var{'addrelatedproduct_url'} = $self->getUrl('func=addRelated');
|
||||
$var{'addrelatedproduct_label'} = $i18n->get(37);
|
||||
foreach my $collateral ( @{ $self->getAllCollateral('relatedJSON')} ) {
|
||||
my $id = $collateral->{relatedAssetId};
|
||||
$segment = $self->session->icon->delete('func=deleteRelatedConfirm&rid='.$id, $self->get('url'),$i18n->get(4))
|
||||
|
|
@ -1384,9 +1388,9 @@ sub view {
|
|||
. $self->session->icon->moveDown('func=moveRelatedDown&rid='.$id, $self->get('url'));
|
||||
my $related = WebGUI::Asset->newByDynamicClass($session, $collateral->{relatedAssetId});
|
||||
push(@relatedloop,{
|
||||
'relatedproduct.URL' => $related->getUrl,
|
||||
'relatedproduct.title' => $related->getTitle,
|
||||
'relatedproduct.controls' => $segment,
|
||||
'relatedproduct_URL' => $related->getUrl,
|
||||
'relatedproduct_title' => $related->getTitle,
|
||||
'relatedproduct_controls' => $segment,
|
||||
});
|
||||
}
|
||||
$var{relatedproduct_loop} = \@relatedloop;
|
||||
|
|
@ -1402,12 +1406,12 @@ sub view {
|
|||
. $self->session->icon->moveUp('func=moveVariantUp&vid='.$id,$self->get('url'))
|
||||
. $self->session->icon->moveDown('func=moveVariantDown&vid='.$id,$self->get('url'));
|
||||
push(@variantLoop,{
|
||||
'variant.controls' => $segment,
|
||||
'variant.sku' => $collateral->{varSku},
|
||||
'variant.title' => $collateral->{shortdesc},
|
||||
'variant.price' => $collateral->{price},
|
||||
'variant.weight' => $collateral->{weight},
|
||||
'variant.quantity' => $collateral->{quantity},
|
||||
'variant_controls' => $segment,
|
||||
'variant_sku' => $collateral->{varSku},
|
||||
'variant_title' => $collateral->{shortdesc},
|
||||
'variant_price' => $collateral->{price},
|
||||
'variant_weight' => $collateral->{weight},
|
||||
'variant_quantity' => $collateral->{quantity},
|
||||
});
|
||||
$variants{$id} = $collateral->{shortdesc};
|
||||
}
|
||||
|
|
@ -1424,8 +1428,8 @@ sub view {
|
|||
);
|
||||
$var{buy_button} = WebGUI::Form::submit($session, { value => $i18n->get('add to cart') } );
|
||||
if ($self->canEdit) {
|
||||
$var{'addvariant.url'} = $self->getUrl('func=editVariant');
|
||||
$var{'addvariant.label'} = $i18n->get('add a variant');
|
||||
$var{'addvariant_url'} = $self->getUrl('func=editVariant');
|
||||
$var{'addvariant_label'} = $i18n->get('add a variant');
|
||||
$var{variant_loop} = \@variantLoop;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue