How to High light item with Problem on status?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
speedythinker
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Sat Sep 23, 2006 1:00 pm

How to High light item with Problem on status?

Post by speedythinker » Wed Jan 26, 2011 1:15 pm

Hello:

I need some help. For paid item but with an issue, I changed the status to "Problem". But without paying attention to it (other staff), it's easy for them to ship it out. I'm wondering if there is a way to high light the row with different color when status is "Problem"

Also, is it way to tell that customer leave a note in the "History & note". I found that we sometimes missed some important instruction from the customer without checking the email. May be add a "!" or some sort of indication to let us know that customer had left message.

Thanks a lot

Speedy

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: How to High light item with Problem on status?

Post by mazhar » Fri Feb 04, 2011 9:52 am

need some help. For paid item but with an issue, I changed the status to "Problem". But without paying attention to it (other staff), it's easy for them to ship it out. I'm wondering if there is a way to high light the row with different color when status is "Problem"
Yep that would be easy. Edit Admin/Orders/Default.aspx.cs file and locate following code

Code: Select all

e.Row.DataItem = order;
and update it like

Code: Select all

e.Row.DataItem = order;
            if (order.OrderStatus.Name.Contains("Problem"))
                e.Row.Style.Add("background-color", "red");
About your second part edit Admin/Orders/Default.aspx and locate

Code: Select all

<asp:TemplateField HeaderText="Shipment">
                    <ItemStyle HorizontalAlign="Left" />
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <asp:PlaceHolder ID="phShipmentStatus" runat="server"></asp:PlaceHolder>
                        <asp:Label ID="ShipmentStatus" runat="server" Text='<%# Eval("ShipmentStatus") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
and then make it look like

Code: Select all

<asp:TemplateField HeaderText="Shipment">
                    <ItemStyle HorizontalAlign="Left" />
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <asp:PlaceHolder ID="phShipmentStatus" runat="server"></asp:PlaceHolder>
                        <asp:Label ID="ShipmentStatus" runat="server" Text='<%# Eval("ShipmentStatus") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Notes">
                    <ItemStyle HorizontalAlign="Left" />
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <%# GetNotesAlert(Container.DataItem)%>
                    </ItemTemplate>
                </asp:TemplateField>
Finally edit Admin/Orders/Default.aspx.cs file and add following method to it

Code: Select all

protected string GetNotesAlert(Object dataItem) 
    {
        string alert = "<span>No</span>";
        Order order = dataItem as Order;
        if (order != null)
        {
            foreach (OrderNote note in order.Notes)
            {
                if (note.NoteType == NoteType.Public)
                {
                    alert = "<span style='color:yellow;'>!</span>";
                    break;
                }
            }
        }
        return alert;
    }

This will print ! in new column when order has at least one public comment otherwise it will say NO.

speedythinker
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Sat Sep 23, 2006 1:00 pm

Re: How to High light item with Problem on status?

Post by speedythinker » Fri Feb 04, 2011 10:48 am

Morning Mazhar:

Thank you for your reply. I tried both and so far only the 1st one (high light Problem item) works very good. But the added "!" seems not working as I click on some orders with customer note left, it won't show any any "!" .

Thanks
Speedy

speedythinker
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Sat Sep 23, 2006 1:00 pm

Re: How to High light item with Problem on status?

Post by speedythinker » Fri Feb 04, 2011 10:51 am

By the way, I saw the new coloumn added with "No" when there is no public note left by the customer. I can live with that.

Thanks again. Great help!!

Speedy

speedythinker
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Sat Sep 23, 2006 1:00 pm

Re: How to High light item with Problem on status?

Post by speedythinker » Fri Feb 04, 2011 10:53 am

Oh... I saw it now. It's just that my eyes didn't see the yellow "!" well. It works!!
Thank you Master

Speedy

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: How to High light item with Problem on status?

Post by mazhar » Mon Feb 07, 2011 4:18 am

Actually it would be better to simply replace ! with Yes. That would be easily visible. You can update that information in this line

Code: Select all

alert = "<span style='color:yellow;'>!</span>"; 
for example like

Code: Select all

alert = "<span style='color:yellow;'>Yes</span>";

kens
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 84
Joined: Wed Apr 04, 2007 7:57 am
Location: West Palm Beach, FL
Contact:

Re: How to High light item with Problem on status?

Post by kens » Thu Feb 10, 2011 9:41 am

Good Morning-

I am using the code posted here to make rows with problem orders red. I wanted to do the same for orders where the payment status is either unprocessed or authorization pending. I tried a variant of your code, but it didn't seem to work, so obviously I'm missing something. Any help would be appreciated. Here is what I tried:

Code: Select all

  if (payment.PaymentStatus == PaymentStatus.Unprocessed)
                e.Row.Style.Add("background-color", "red");

Thanks

Ken

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: How to High light item with Problem on status?

Post by mazhar » Thu Feb 10, 2011 10:37 am

do it like this, hopefully it will workout

Code: Select all

if (order.PaymentStatus == PaymentStatus.Unprocessed)
                e.Row.Style.Add("background-color", "red");

speedythinker
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Sat Sep 23, 2006 1:00 pm

Re: How to High light item with Problem on status?

Post by speedythinker » Fri Feb 11, 2011 11:49 am

Hello Mazhar:

I want to show you our gradatude for your help. Now, it really a big release of pressure we used to have of worring missing an instruction left by a customer or shipping out problematic order without knowlege. Without your great work, we're living in a dark room and wasting much time to deal with tedious job by reading email and checking "History and Note" order by order.

Again, my appreciation for your great effort. You're the man!!


Cheers!
Speedy

User avatar
Mizmo67
Commander (CMDR)
Commander (CMDR)
Posts: 155
Joined: Wed Mar 16, 2005 5:35 pm
Location: NJ
Contact:

Re: How to High light item with Problem on status?

Post by Mizmo67 » Wed May 11, 2011 2:53 pm

This code addition below e.Row.DataItem = order;

Code: Select all

if (order.PaymentStatus = PaymentStatus.Unprocessed)
                e.Row.Style.Add("background-color", "red");
Gives ERROR: e:\hshome\scottsbt\store.scottsbt.com\Admin\Orders\Default.aspx.cs(371): error CS0266: Cannot implicitly convert type 'CommerceBuilder.Payments.PaymentStatus' to 'CommerceBuilder.Orders.OrderPaymentStatus'. An explicit conversion exists (are you missing a cast?)


I've been trying all kinds of variations but cannot get it to work?
Thanks, ~Mo
~Mo

Maureen Albertson
Scott's Bait & Tackle / Mystic Reel Parts LLC
Contact Me Via Store Website
Image
Ablecommerce Gold R11 Catalog LIVE

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: How to High light item with Problem on status?

Post by mazhar » Thu May 12, 2011 2:15 am

You are using single = operator in this line

Code: Select all

if (order.PaymentStatus = PaymentStatus.Unprocessed)
correct it like

Code: Select all

if (order.PaymentStatus == PaymentStatus.Unprocessed)
Single = sign means assignment while two = signs means check for equality.

User avatar
Mizmo67
Commander (CMDR)
Commander (CMDR)
Posts: 155
Joined: Wed Mar 16, 2005 5:35 pm
Location: NJ
Contact:

Re: How to High light item with Problem on status?

Post by Mizmo67 » Thu May 12, 2011 12:10 pm

Unfortunately,

Code: Select all

if (order.PaymentStatus == PaymentStatus.Unprocessed)
                e.Row.Style.Add("background-color", "red");
Gets me another error: e:\hshome\scottsbt\store.scottsbt.com\Admin\Orders\Default.aspx.cs(371): error CS0019: Operator '==' cannot be applied to operands of type 'CommerceBuilder.Orders.OrderPaymentStatus' and 'CommerceBuilder.Payments.PaymentStatus'

:(
~Mo

Maureen Albertson
Scott's Bait & Tackle / Mystic Reel Parts LLC
Contact Me Via Store Website
Image
Ablecommerce Gold R11 Catalog LIVE

Post Reply