Page 1 of 1

How to display approved transactions only in My Account

Posted: Tue Dec 30, 2008 10:31 am
by caveman
Is it possible to display the approved transactions only on /Members/MyAccount.aspx. Also where can I modify the number of transactions displayed on this page?

Re: How to display approved transactions only in My Account

Posted: Wed Dec 31, 2008 9:12 am
by mazhar
Please explain you question a little bit.

Re: How to display approved transactions only in My Account

Posted: Wed Dec 31, 2008 10:53 am
by caveman
I'm refering to page that appears when you login as a registered user... the MyAccounts.aspx page. That page displays ALL transactions, Payment Authorized and Failed Transactions. I'd like to display only the successfully Payment Authorized transactions. Also, How do you change the number of orders listed on the page to more than 3.

Image

Re: How to display approved transactions only in My Account

Posted: Wed Dec 31, 2008 11:39 am
by mazhar
Also, How do you change the number of orders listed on the page to more than 3.
In the code find the following line of code and change the value according to your requirement

Code: Select all

private int maxOrders = 3;
I'm refering to page that appears when you login as a registered user... the MyAccounts.aspx page. That page displays ALL transactions, Payment Authorized and Failed Transactions. I'd like to display only the successfully Payment Authorized transactions.
Edit the MyAccountPage.ascx file and find the following code

Code: Select all

<asp:GridView ID="OrderGrid" runat="server" AutoGenerateColumns="False" ShowHeader="false" GridLines="none" 
            Width="100%" CellPadding="4" RowStyle-CssClass="altodd" AlternatingRowStyle-CssClass="alteven">
and made it look like

Code: Select all

<asp:GridView ID="OrderGrid" runat="server" AutoGenerateColumns="False" ShowHeader="false" GridLines="none" 
            Width="100%" CellPadding="4" RowStyle-CssClass="altodd" AlternatingRowStyle-CssClass="alteven" OnRowCreated="OrderGrid_RowCreated">
Now edit the MyAccountPage.ascx.cs file and add following method to it

Code: Select all

protected void OrderGrid_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Order order = (Order)e.Row.DataItem;
            e.Row.Visible = (order.PaymentStatus == OrderPaymentStatus.Paid);
        }
    }

Re: How to display approved transactions only in My Account

Posted: Thu Jan 01, 2009 2:44 pm
by caveman
The solution worked perfectly! Thanks Mazhar.