diff --git a/docs/upgrades/upgrade_7.5.10-7.5.11.pl b/docs/upgrades/upgrade_7.5.10-7.5.11.pl index 5ca7f8d7c..72ed4cf49 100644 --- a/docs/upgrades/upgrade_7.5.10-7.5.11.pl +++ b/docs/upgrades/upgrade_7.5.10-7.5.11.pl @@ -928,6 +928,7 @@ sub migrateOldProduct { $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 + $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 benefitJSON mediumtext'); $session->db->write('alter table Product add column featureJSON mediumtext'); @@ -1396,7 +1397,7 @@ sub addVersionStartEndDates { #------------------------------------------------- sub migrateSubscriptions { 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. my ($hasDoubles) = $session->db->buildArray( diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index ad6030b60..c301f42a5 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -102,6 +102,13 @@ sub definition { hoverHelp=>$i18n->get('62 description'), 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=>{ tab => "properties", fieldType=>"image", @@ -969,7 +976,8 @@ sub www_buy { if ($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{variant_loop} = \@variantLoop; + $var{hasAddedToCart} = $self->{_hasAddedToCart}; my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate}); if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) { diff --git a/lib/WebGUI/Help/Asset_Product.pm b/lib/WebGUI/Help/Asset_Product.pm index 6fbb9e837..77e17271e 100644 --- a/lib/WebGUI/Help/Asset_Product.pm +++ b/lib/WebGUI/Help/Asset_Product.pm @@ -61,6 +61,8 @@ our $HELP = { { 'name' => 'buy_form_options' }, { 'name' => 'buy_form_button' }, { 'name' => 'buy_form_footer' }, + { 'name' => "hasAddedToCart" , required=>1 }, + { 'name' => "thankYouMessage", description=>"thank you message help" }, { 'name' => 'addspecification_url' }, { 'name' => 'addspecification_label' }, { 'name' => 'specification_loop', diff --git a/lib/WebGUI/i18n/English/Asset_Product.pm b/lib/WebGUI/i18n/English/Asset_Product.pm index 58dd37023..5406cd017 100644 --- a/lib/WebGUI/i18n/English/Asset_Product.pm +++ b/lib/WebGUI/i18n/English/Asset_Product.pm @@ -805,6 +805,30 @@ be useful, others may not.|, 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;