Page 1 of 1
Create New Order Problem 7.0.3
Posted: Tue Jun 02, 2009 3:25 pm
by SamsSteins
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?
Re: Create New Order Problem 7.0.3
Posted: Wed Jun 03, 2009 6:23 am
by mazhar
Thanks, I am to reproduce the problem. you can track progress on this issue here
http://bugs.ablecommerce.com/show_bug.cgi?id=8127
Re: Create New Order Problem 7.0.4
Posted: Wed Jan 06, 2010 12:54 pm
by SamsSteins
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.
Re: Create New Order Problem 7.0.3
Posted: Thu Jan 07, 2010 5:18 am
by mazhar
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.