add hasAddedToCart and thankYouMessage template variables
This commit is contained in:
parent
bbe0ee5ea3
commit
bfd1f3ae07
4 changed files with 38 additions and 2 deletions
|
|
@ -928,6 +928,7 @@ sub migrateOldProduct {
|
||||||
$session->db->write(q!update asset set className='WebGUI::Asset::Sku::Product' where className='WebGUI::Asset::Wobject::Product'!);
|
$session->db->write(q!update asset set className='WebGUI::Asset::Sku::Product' where className='WebGUI::Asset::Wobject::Product'!);
|
||||||
|
|
||||||
## Add variants collateral column to Sku/Product
|
## Add variants collateral column to Sku/Product
|
||||||
|
$session->db->write('alter table Product add column thankYouMessage mediumtext');
|
||||||
$session->db->write('alter table Product add column accessoryJSON mediumtext');
|
$session->db->write('alter table Product add column accessoryJSON mediumtext');
|
||||||
$session->db->write('alter table Product add column benefitJSON mediumtext');
|
$session->db->write('alter table Product add column benefitJSON mediumtext');
|
||||||
$session->db->write('alter table Product add column featureJSON mediumtext');
|
$session->db->write('alter table Product add column featureJSON mediumtext');
|
||||||
|
|
@ -1396,7 +1397,7 @@ sub addVersionStartEndDates {
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
sub migrateSubscriptions {
|
sub migrateSubscriptions {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
print "\tMigrating subscriptions to the new commerce system..." unless ($quiet);
|
print "\tMigrating subscriptions to the new commerce system...\n" unless ($quiet);
|
||||||
|
|
||||||
# Check if codes are tied to multiple subscriptions.
|
# Check if codes are tied to multiple subscriptions.
|
||||||
my ($hasDoubles) = $session->db->buildArray(
|
my ($hasDoubles) = $session->db->buildArray(
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,13 @@ sub definition {
|
||||||
hoverHelp=>$i18n->get('62 description'),
|
hoverHelp=>$i18n->get('62 description'),
|
||||||
defaultValue=>'PBtmpl0000000000000056'
|
defaultValue=>'PBtmpl0000000000000056'
|
||||||
},
|
},
|
||||||
|
thankYouMessage => {
|
||||||
|
tab => "properties",
|
||||||
|
defaultValue => $i18n->get("default thank you message"),
|
||||||
|
fieldType => "HTMLArea",
|
||||||
|
label => $i18n->get("thank you message"),
|
||||||
|
hoverHelp => $i18n->get("thank you message help"),
|
||||||
|
},
|
||||||
image1=>{
|
image1=>{
|
||||||
tab => "properties",
|
tab => "properties",
|
||||||
fieldType=>"image",
|
fieldType=>"image",
|
||||||
|
|
@ -969,7 +976,8 @@ sub www_buy {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->view($error);
|
$self->view($error);
|
||||||
}
|
}
|
||||||
return '';
|
$self->{_hasAddedToCart} = 1;
|
||||||
|
return $self->www_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -1576,6 +1584,7 @@ sub view {
|
||||||
$var{'addvariant_label'} = $i18n->get('add a variant');
|
$var{'addvariant_label'} = $i18n->get('add a variant');
|
||||||
}
|
}
|
||||||
$var{variant_loop} = \@variantLoop;
|
$var{variant_loop} = \@variantLoop;
|
||||||
|
$var{hasAddedToCart} = $self->{_hasAddedToCart};
|
||||||
|
|
||||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ our $HELP = {
|
||||||
{ 'name' => 'buy_form_options' },
|
{ 'name' => 'buy_form_options' },
|
||||||
{ 'name' => 'buy_form_button' },
|
{ 'name' => 'buy_form_button' },
|
||||||
{ 'name' => 'buy_form_footer' },
|
{ 'name' => 'buy_form_footer' },
|
||||||
|
{ 'name' => "hasAddedToCart" , required=>1 },
|
||||||
|
{ 'name' => "thankYouMessage", description=>"thank you message help" },
|
||||||
{ 'name' => 'addspecification_url' },
|
{ 'name' => 'addspecification_url' },
|
||||||
{ 'name' => 'addspecification_label' },
|
{ 'name' => 'addspecification_label' },
|
||||||
{ 'name' => 'specification_loop',
|
{ 'name' => 'specification_loop',
|
||||||
|
|
|
||||||
|
|
@ -805,6 +805,30 @@ be useful, others may not.|,
|
||||||
lastUpdated => 1211168991,
|
lastUpdated => 1211168991,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'default thank you message' => {
|
||||||
|
message => q|Thank you for your purchase.|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|the default message that will go in the thank you message field|
|
||||||
|
},
|
||||||
|
|
||||||
|
'thank you message' => {
|
||||||
|
message => q|Thank You Message|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|the label for the field where you type in a message thanking the user for their purchase|
|
||||||
|
},
|
||||||
|
|
||||||
|
'thank you message help' => {
|
||||||
|
message => q|Write a thank you message to your user for buying something from your site. Be sincere, or they may cancel their purchase and get it from Amazon instead.|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|help for default price field|
|
||||||
|
},
|
||||||
|
|
||||||
|
'hasAddedToCart' => {
|
||||||
|
message => q|A condition indicating that the user has added the product to their cart, so we can display the thank you message.|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|template variable|
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue