From 93b0e226800fbfc1d5b4d937377ef5f93b0f3271 Mon Sep 17 00:00:00 2001 From: Joeri de Bruin Date: Fri, 23 Oct 2009 12:18:36 +0000 Subject: [PATCH] fix: Fixed a bug where www_selectPaymentGateway was not templated (#11161) --- ...-collateral-items_select-gateway-default.wgpkg | Bin 0 -> 916 bytes docs/upgrades/upgrade_7.8.2-7.8.3.pl | 11 ++++++++++- lib/WebGUI/Shop/Admin.pm | 9 ++++++++- lib/WebGUI/Shop/Pay.pm | 12 ++++++++---- lib/WebGUI/i18n/English/Shop.pm | 12 ++++++++++++ 5 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 docs/upgrades/packages-7.8.3/shopping-cart-collateral-items_select-gateway-default.wgpkg diff --git a/docs/upgrades/packages-7.8.3/shopping-cart-collateral-items_select-gateway-default.wgpkg b/docs/upgrades/packages-7.8.3/shopping-cart-collateral-items_select-gateway-default.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..57ad125e4ff66e06b38e758a5f20310b2a40f8a0 GIT binary patch literal 916 zcmV;F18e*riwFP!00000|Ls+4Z`v>v&FB7#D4#ZIlq9?gVn|&_TeLn(0 z&u_RDuPQ&5ZOgc8*)nDGE8zk#32jUuLoYZ^UQ({~lIeOup|?#{Xg&R1*-3xb$~B0p&UIe2j_x;LkPkP5b-_;?qoR$Xyr&U z!;oEa$a*Sff?Y{hhu*Lotj`6ULy@QX2lMgx?kqXG3ooNVKM2nHW4f#NCM;GJ_=r%7 za8wEa6QzK}Dd7ynB_!GBWe#H)h*BgU&cLD+!dsBULYG1O5QQPcs+MOy?=vEZSkR0< zgPn+xg!aO2h=j^A)F=d3&)XrI+9>>d=i4X*L?Dmk^<*aylnVtWausX&?@kmZ+amnI+ zMkam0Bs>M*xUuS@y%E6Cvn_})%)8jp6VFxCub6xKyg+s=KLL}B)@wLCxa_rByQ%W6 z)#!&AW}jTWiJO%Y5A#XOXY%dbf4X*?i=S& zz@)L1JZqS1wGJW5C!?K4s1wk&nv{-KTTzsu-;YvNQoPYA> zI$vgXd)ANZoY*#8*esOT5`7db->write("insert into settings values ('selectGatewayTemplateId', '2GxjjkRuRkdUg_PccRPjpA');"); + print "Done.\n" unless $quiet; +} + #sub exampleFunction { # my $session = shift; # print "\tWe're doing some stuff here that you should know about... " unless $quiet; diff --git a/lib/WebGUI/Shop/Admin.pm b/lib/WebGUI/Shop/Admin.pm index ce4cedd2d..8dc24fb74 100644 --- a/lib/WebGUI/Shop/Admin.pm +++ b/lib/WebGUI/Shop/Admin.pm @@ -180,6 +180,13 @@ sub www_editSettings { label => $i18n->get("edit address template"), hoverHelp => $i18n->get("edit address template help"), ); + $form->template( + name => "selectGatewayTemplateId", + value => $setting->get("selectGatewayTemplateId"), + label => $i18n->get("select gateway template"), + namespace => "Shop/selectGateway", + hoverHelp => $i18n->get("select gateway template help"), + ); $form->template( name => "shopMyPurchasesTemplateId", value => $setting->get("shopMyPurchasesTemplateId"), @@ -226,7 +233,7 @@ sub www_editSettingsSave { # Save shop templates foreach my $template (qw(shopMyPurchasesDetailTemplateId shopMyPurchasesTemplateId - shopCartTemplateId shopAddressBookTemplateId shopAddressTemplateId shopReceiptEmailTemplateId)) { + shopCartTemplateId shopAddressBookTemplateId shopAddressTemplateId selectGatewayTemplateId shopReceiptEmailTemplateId)) { $setting->set($template, $form->get($template, "template")); } diff --git a/lib/WebGUI/Shop/Pay.pm b/lib/WebGUI/Shop/Pay.pm index b33d6ca17..515a614ff 100644 --- a/lib/WebGUI/Shop/Pay.pm +++ b/lib/WebGUI/Shop/Pay.pm @@ -423,12 +423,16 @@ sub www_selectPaymentGateway { # TODO: If only one payOption exists, just send us there # In order to do this, the PayDriver must give us a direct URL to go to - my $output .= $i18n->get('choose payment gateway message'); + my $var; + my @paymentGateways; foreach my $payOption ( values %{$payOptions} ) { - $output .= $payOption->{button} . '
'; + push @paymentGateways, $payOption; } - - return $session->style->userStyle( $output ); + $var->{ paymentGateways } = \@paymentGateways; + $var->{ choose } = $i18n->get('choose payment gateway message'); + $session->log->warn('###'.$session->setting->get("selectGatewayTemplateId")); + my $template = WebGUI::Asset::Template->new($session, $session->setting->get("selectGatewayTemplateId")); + return $session->style->userStyle($template->process($var)); } 1; diff --git a/lib/WebGUI/i18n/English/Shop.pm b/lib/WebGUI/i18n/English/Shop.pm index 018dd39cc..28e7de7f5 100644 --- a/lib/WebGUI/i18n/English/Shop.pm +++ b/lib/WebGUI/i18n/English/Shop.pm @@ -669,6 +669,18 @@ our $I18N = { context => q|commerce setting help| }, + 'select gateway template' => { + message => q|Select Gateway Template|, + lastUpdated => 0, + context => q|commerce setting| + }, + + 'select gateway template help' => { + message => q|This template is the template for the Select Payment Gateway step.|, + lastUpdated => 0, + context => q|commerce setting help| + }, + 'transactions' => { message => q|Transactions|, lastUpdated => 0,