added thank you page
fixed bug in minicart added user transaction detail page
This commit is contained in:
parent
c913c3ede3
commit
93454e36f9
9 changed files with 115 additions and 23 deletions
Binary file not shown.
|
|
@ -545,7 +545,7 @@ sub convertTransactionLog {
|
||||||
index vendorId (vendorId)
|
index vendorId (vendorId)
|
||||||
)");
|
)");
|
||||||
$session->setting->add('shopMyPurchasesTemplateId','');
|
$session->setting->add('shopMyPurchasesTemplateId','');
|
||||||
$session->setting->add('shopMyPurchaseDetailTemplateId','');
|
$session->setting->add('shopMyPurchasesDetailTemplateId','g8W53Pd71uHB9pxaXhWf_A');
|
||||||
my $transactionResults = $db->read("select * from oldtransaction order by initDate");
|
my $transactionResults = $db->read("select * from oldtransaction order by initDate");
|
||||||
while (my $oldTranny = $transactionResults->hashRef) {
|
while (my $oldTranny = $transactionResults->hashRef) {
|
||||||
my $date = WebGUI::DateTime->new($session, $oldTranny->{initDate});
|
my $date = WebGUI::DateTime->new($session, $oldTranny->{initDate});
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ sub process {
|
||||||
}
|
}
|
||||||
my %var = (
|
my %var = (
|
||||||
items => \@items,
|
items => \@items,
|
||||||
totalPrice => sprintf(".2f",$totalPrice),
|
totalPrice => sprintf("%.2f",$totalPrice),
|
||||||
totalItems => $totalItems,
|
totalItems => $totalItems,
|
||||||
);
|
);
|
||||||
my $template = WebGUI::Asset::Template->new($session, $templateId || 'EBlxJpZQ9o-8VBOaGQbChA');
|
my $template = WebGUI::Asset::Template->new($session, $templateId || 'EBlxJpZQ9o-8VBOaGQbChA');
|
||||||
|
|
|
||||||
|
|
@ -143,16 +143,16 @@ sub www_editSettings {
|
||||||
hoverHelp => $i18n->get("edit address template help"),
|
hoverHelp => $i18n->get("edit address template help"),
|
||||||
);
|
);
|
||||||
$form->template(
|
$form->template(
|
||||||
name => "myPurchasesTemplateId",
|
name => "shopMyPurchasesTemplateId",
|
||||||
value => $setting->get("myPurchasesTemplateId"),
|
value => $setting->get("shopMyPurchasesTemplateId"),
|
||||||
namespace => "Shop/MyPurchases",
|
namespace => "Shop/MyPurchases",
|
||||||
label => $i18n->get("my purchases template"),
|
label => $i18n->get("my purchases template"),
|
||||||
hoverHelp => $i18n->get("my purchases template help"),
|
hoverHelp => $i18n->get("my purchases template help"),
|
||||||
);
|
);
|
||||||
$form->template(
|
$form->template(
|
||||||
name => "myPurchasesDetailTemplateId",
|
name => "shopMyPurchasesDetailTemplateId",
|
||||||
value => $setting->get("myPurchasesDetailTemplateId"),
|
value => $setting->get("shopMyPurchasesDetailTemplateId"),
|
||||||
namespace => "Shop/MyPurchases/Detail",
|
namespace => "Shop/MyPurchasesDetail",
|
||||||
label => $i18n->get("my purchases detail template"),
|
label => $i18n->get("my purchases detail template"),
|
||||||
hoverHelp => $i18n->get("my purchases detail template help"),
|
hoverHelp => $i18n->get("my purchases detail template help"),
|
||||||
);
|
);
|
||||||
|
|
@ -172,6 +172,8 @@ sub www_editSettingsSave {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->session->privilege->adminOnly() unless ($self->session->user->isInGroup("3"));
|
return $self->session->privilege->adminOnly() unless ($self->session->user->isInGroup("3"));
|
||||||
my ($setting, $form) = $self->session->quick(qw(setting form));
|
my ($setting, $form) = $self->session->quick(qw(setting form));
|
||||||
|
$setting->set("shopMyPurchasesDetailTemplateId", $form->get("shopMyPurchasesDetailTemplateId", "template"));
|
||||||
|
$setting->set("shopMyPurchasesTemplateId", $form->get("shopMyPurchasesTemplateId", "template"));
|
||||||
$setting->set("shopCartTemplateId", $form->get("shopCartTemplateId", "template"));
|
$setting->set("shopCartTemplateId", $form->get("shopCartTemplateId", "template"));
|
||||||
$setting->set("shopAddressBookTemplateId", $form->get("shopAddressBookTemplateId", "template"));
|
$setting->set("shopAddressBookTemplateId", $form->get("shopAddressBookTemplateId", "template"));
|
||||||
$setting->set("shopAddressTemplateId", $form->get("shopAddressTemplateId", "template"));
|
$setting->set("shopAddressTemplateId", $form->get("shopAddressTemplateId", "template"));
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ sub www_selectPaymentGateway {
|
||||||
my $transaction = WebGUI::Shop::Transaction->create($session, {cart => $cart});
|
my $transaction = WebGUI::Shop::Transaction->create($session, {cart => $cart});
|
||||||
$transaction->completePurchase('zero', 'success', 'success');
|
$transaction->completePurchase('zero', 'success', 'success');
|
||||||
$cart->onCompletePurchase;
|
$cart->onCompletePurchase;
|
||||||
$transaction->www_thankYou($session);
|
$transaction->thankYou();
|
||||||
}
|
}
|
||||||
|
|
||||||
# All the output stuff below is just a placeholder until it's templated.
|
# All the output stuff below is just a placeholder until it's templated.
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ sub www_pay {
|
||||||
# Complete the transaction
|
# Complete the transaction
|
||||||
my $transaction = $self->processTransaction( $billingAddress );
|
my $transaction = $self->processTransaction( $billingAddress );
|
||||||
|
|
||||||
return $transaction->www_thankYou($session);
|
return $transaction->thankYou();
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -595,7 +595,7 @@ sub www_pay {
|
||||||
# Payment time!
|
# Payment time!
|
||||||
my $transaction = $self->processTransaction;
|
my $transaction = $self->processTransaction;
|
||||||
|
|
||||||
return $transaction->www_thankYou($session);
|
return $transaction->thankYou();
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -437,6 +437,23 @@ sub newByGatewayId {
|
||||||
return $class->new( $session, $transactionId );
|
return $class->new( $session, $transactionId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 thankYou ()
|
||||||
|
|
||||||
|
Displays the default thank you page.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub thankYou {
|
||||||
|
my ($self) = @_;
|
||||||
|
my $i18n = WebGUI::International->new($self->session,'Shop');
|
||||||
|
return $self->www_viewMy($self->session, $self, $i18n->get('thank you message'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 update ( properties )
|
=head2 update ( properties )
|
||||||
|
|
@ -765,19 +782,6 @@ sub www_refundItem {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 www_thankYou ()
|
|
||||||
|
|
||||||
Displays the default thank you page.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub www_thankYou {
|
|
||||||
my ($class, $session) = @_;
|
|
||||||
return q{Thanks for your order. Need to template this.};
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
=head2 www_view ()
|
=head2 www_view ()
|
||||||
|
|
||||||
Displays the admin view of an individual transaction.
|
Displays the admin view of an individual transaction.
|
||||||
|
|
@ -1008,6 +1012,86 @@ sub www_viewItem {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_viewMy ()
|
||||||
|
|
||||||
|
Displays transaction detail for a user's purchase.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub www_viewMy {
|
||||||
|
my ($class, $session, $transaction, $notice) = @_;
|
||||||
|
unless (defined $transaction) {
|
||||||
|
$transaction = $class->new($session, $session->form->get('transactionId'));
|
||||||
|
}
|
||||||
|
return $session->insufficient unless ($transaction->get('userId') eq $session->user->userId);
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Shop');
|
||||||
|
my ($style, $url) = $session->quick(qw(style url));
|
||||||
|
my %var = (
|
||||||
|
%{$transaction->get},
|
||||||
|
notice => $notice,
|
||||||
|
cancelRecurringUrl => $url->page('shop=transaction;method=cancelRecurring;transactionId='.$transaction->getId),
|
||||||
|
amount => sprintf("%.2f", $transaction->get('amount')),
|
||||||
|
inShopCreditDeduction => sprintf("%.2f", $transaction->get('inShopCreditDeduction')),
|
||||||
|
taxes => sprintf("%.2f", $transaction->get('taxes')),
|
||||||
|
shippingPrice => sprintf("%.2f", $transaction->get('shippingPrice')),
|
||||||
|
shippingAddress => $transaction->formatAddress({
|
||||||
|
name => $transaction->get('shippingAddressName'),
|
||||||
|
address1 => $transaction->get('shippingAddress1'),
|
||||||
|
address2 => $transaction->get('shippingAddress2'),
|
||||||
|
address3 => $transaction->get('shippingAddress3'),
|
||||||
|
city => $transaction->get('shippingCity'),
|
||||||
|
state => $transaction->get('shippingState'),
|
||||||
|
code => $transaction->get('shippingCode'),
|
||||||
|
country => $transaction->get('shippingCountry'),
|
||||||
|
phoneNumber => $transaction->get('shippingPhoneNumber'),
|
||||||
|
}),
|
||||||
|
paymentAddress => $transaction->formatAddress({
|
||||||
|
name => $transaction->get('paymentAddressName'),
|
||||||
|
address1 => $transaction->get('paymentAddress1'),
|
||||||
|
address2 => $transaction->get('paymentAddress2'),
|
||||||
|
address3 => $transaction->get('paymentAddress3'),
|
||||||
|
city => $transaction->get('paymentCity'),
|
||||||
|
state => $transaction->get('paymentState'),
|
||||||
|
code => $transaction->get('paymentCode'),
|
||||||
|
country => $transaction->get('paymentCountry'),
|
||||||
|
phoneNumber => $transaction->get('paymentPhoneNumber'),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
# items
|
||||||
|
my @items = ();
|
||||||
|
foreach my $item (@{$transaction->getItems}) {
|
||||||
|
my $address = '';
|
||||||
|
if ($transaction->get('shippingAddressId') ne $item->get('shippingAddressId')) {
|
||||||
|
$address = $transaction->formatAddress({
|
||||||
|
name => $item->get('shippingAddressName'),
|
||||||
|
address1 => $item->get('shippingAddress1'),
|
||||||
|
address2 => $item->get('shippingAddress2'),
|
||||||
|
address3 => $item->get('shippingAddress3'),
|
||||||
|
city => $item->get('shippingCity'),
|
||||||
|
state => $item->get('shippingState'),
|
||||||
|
code => $item->get('shippingCode'),
|
||||||
|
country => $item->get('shippingCountry'),
|
||||||
|
phoneNumber => $item->get('shippingPhoneNumber'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
push @items, {
|
||||||
|
%{$item->get},
|
||||||
|
viewItemUrl => $url->page('shop=transaction;method=viewItem;transactionId='.$transaction->getId.';itemId='.$item->getId),
|
||||||
|
price => sprintf("%.2f", $item->get('price')),
|
||||||
|
itemShippingAddress => $address,
|
||||||
|
orderStatus => $i18n->get($item->get('orderStatus')),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
$var{items} = \@items;
|
||||||
|
|
||||||
|
# render
|
||||||
|
my $template = WebGUI::Asset::Template->new($session, $session->setting->get("shopMyPurchasesDetailTemplateId"));
|
||||||
|
return $style->userStyle($template->process(\%var));
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 www_update ( )
|
=head2 www_update ( )
|
||||||
|
|
||||||
Sets the properties for the transaction, specifically "notes".
|
Sets the properties for the transaction, specifically "notes".
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,12 @@ package WebGUI::i18n::English::Shop;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
our $I18N = {
|
our $I18N = {
|
||||||
|
'thank you message' => {
|
||||||
|
message => q|Thank you for your order! Please print this page as your receipt.|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|notice after purchase|,
|
||||||
|
},
|
||||||
|
|
||||||
'shop notice' => {
|
'shop notice' => {
|
||||||
message => q|Shop Notice|,
|
message => q|Shop Notice|,
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue