Create New Order Problem 7.0.3

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
SamsSteins
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Jul 10, 2008 11:43 am
Location: Lancaster PA
Contact:

Create New Order Problem 7.0.3

Post by SamsSteins » Tue Jun 02, 2009 3:25 pm

When taking a telelphone order through my newly update website I was surprised to notice that it is allowing me to order out of stock products. Is there some setting I need to change, that if a customer gives me a product number and I enter it and it happens to be out of stock that it does not let the order take place?

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

Re: Create New Order Problem 7.0.3

Post by mazhar » Wed Jun 03, 2009 6:23 am

Thanks, I am to reproduce the problem. you can track progress on this issue here
http://bugs.ablecommerce.com/show_bug.cgi?id=8127

SamsSteins
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Jul 10, 2008 11:43 am
Location: Lancaster PA
Contact:

Re: Create New Order Problem 7.0.4

Post by SamsSteins » Wed Jan 06, 2010 12:54 pm

Any progress on this? Even if there was a pop-up to notify me that an item is out of stock taking the order. As it is now, I am not notified until the final step and after taking a person's name and address and payment information I do not like telling them I cannot fulfill their order.

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

Re: Create New Order Problem 7.0.3

Post by mazhar » Thu Jan 07, 2010 5:18 am

Here is fix for this, Edit you Website/Admin/Orders/Create/CreateOrder2.aspx file and locate following code

Code: Select all

<asp:GridView ID="FindProductSearchResults" runat="server" AutoGenerateColumns="false" 
                                        DataSourceID="AddProductDs" AllowPaging="true" PageSize="10" AllowSorting="true" 
                                        Visible="false" OnRowCommand="FindProductSearchResults_RowCommand" 
                                        SkinID="PagedList" Width="100%" >
then update it as below

Code: Select all

<asp:GridView ID="FindProductSearchResults" runat="server" AutoGenerateColumns="false" 
                                        DataSourceID="AddProductDs" AllowPaging="true" PageSize="10" AllowSorting="true" 
                                        Visible="false" OnRowCommand="FindProductSearchResults_RowCommand" 
                                        SkinID="PagedList" Width="100%" 
                                        onrowcreated="FindProductSearchResults_RowCreated">
Save it and then edit Website/Admin/Orders/Create/CreateOrder2.aspx.cs file and add following method to it

Code: Select all

protected void FindProductSearchResults_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if(e.Row.RowType == DataControlRowType.DataRow)
        {
            ImageButton imageButton = (ImageButton)e.Row.FindControl("AddButton");
            Product product = (Product)e.Row.DataItem;
            if (product == null || imageButton == null)
                return;
            string outofstockWarnningScript = "return confirm('{0}')";
            if (product.AllowBackorder)
                return;
            if (product.InStock == 0)
                outofstockWarnningScript = string.Format(outofstockWarnningScript, product.Name + " is out of stock. Are you sure you want to add it to current basket");
            else
            if (product.InStockWarningLevel >= product.InStock)
                outofstockWarnningScript = string.Format(outofstockWarnningScript, product.Name + " In Stock level is lower then warnning level.");
            imageButton.OnClientClick = outofstockWarnningScript;
        }
    }
Now try placing order for some product with low instock value, it will show you a confirm dialog to proceed with product purchase.

Post Reply