Page 1 of 1

How to set Order Number to Custom value

Posted: Mon Dec 07, 2015 8:04 am
by ImmortalLogic
In previous versions of AbleCommerce, there was an option to set the desired OrderID to start and increment (I think) in Admin. However with version 10 and 11, I cannot see how to do this. I have tried manually setting the database to the value we want to begin with but it always reverts back to the original order number (with some increments due to fake transcations). What is the best way to modify the order number/id starting point?

Thanks.

Re: How to set Order Number to Custom value

Posted: Mon Dec 07, 2015 9:01 am
by rmaweb
Hello ImmortalLogic,

In the admin section go to Configure -> Store -> General and look on the left side of the page under the Order Settings heading.

Re: How to set Order Number to Custom value

Posted: Tue Dec 08, 2015 5:13 am
by ImmortalLogic
Thanks for your response but it only displays a value in label and not text box. It does not seem as if it can be modified. Changing it in the database works for one order, then it moves back to the the original 10 digit order number. How can we set our custom order number?

Re: How to set Order Number to Custom value

Posted: Tue Dec 08, 2015 9:39 am
by Katie
Someone has customized this page so you can't change the order number. This field has always been available for editing.

Re: How to set Order Number to Custom value

Posted: Tue Dec 08, 2015 10:43 am
by ImmortalLogic
Katie,

That is not possible--no one has customized the page. I am the only one to work on this project and after installing version 10, this is what I see using the version 10 files. The version we used before was editable.

Re: How to set Order Number to Custom value

Posted: Tue Dec 08, 2015 10:57 am
by Katie
Maybe it was changed to be compatible for a plug-in? If you have a stock version of the R10 files, then you can compare the files for /Admin/Store/StoreSettings.aspx. I am sure this field has always been editable.

Re: How to set Order Number to Custom value

Posted: Tue Dec 08, 2015 11:05 am
by jguengerich
I believe this may be the problem: In /Admin/Store/StoreSettings.aspx.cs, in the UpdateNextOrderNumber() method (which is called in Page_Load), is the following code:

Code: Select all

            if (store.NextOrderId > 99999999)
            {
                NextOrderIdLabel.Text = OrigNextOrderNumber.Value;
                NextOrderIdLabel.Visible = true;
                NextOrderId.Visible = false;
                NextOrderNumberRangeValidator1.Enabled = false;
                NextOrderNumberRangeValidator1.Visible = false;
            }
This hides the text box and shows a label with the value instead.
Maybe someone from AbleCommerce can say why that's there?

Re: How to set Order Number to Custom value

Posted: Tue Dec 08, 2015 11:20 am
by Katie
I don't know why, so we'll have to get some input from someone in the dev team. They have already gone home for the day, so we'll have to wait until tomorrow for an answer.

Re: How to set Order Number to Custom value

Posted: Tue Dec 08, 2015 11:48 am
by ImmortalLogic
Thanks for your help jguengerich and Katie!

Re: How to set Order Number to Custom value

Posted: Wed Dec 09, 2015 5:23 am
by mazhar
It seems like current value in Store.NextOrderId field exceeding the validation limits making it read only. I see you noted that you are able to correct in database but it reverts back. May be some customization or cached values is saved back reverted direct database edit? You should try this, first recycle app pool and make sure to not access the website while you are making change in db, then change the value in database to your desired value. You can calculate the value by simply finding the maximum order number in ac_Orders table and then increment that value by one. Then recycle app pool once again and access the admin panel. Let's see if it reverts the value again or it sticks this time.

Also please run the query and see what is the maximum order number you have?
SELECT MAX(OrderNumber) FROM ac_Orders