This article provides the steps to take to understand the modifications that you have to make to add a status code. You might have to take additional steps based on your Commerce site and specific needs.
Use the Orders module to search your Commerce Server database for existing order information. With order status, you can track the location of an order in the order process. There are three default order status codes:
- 4 (New Order)
- 2 (Saved Order)
- 1 (Basket)
To add order status codes to track the location of an order in the order process, see the product documentation: Commerce Server 2000\Working with Business Desk\Business Desk Orders\Adding Order Status Codes.
Modify the User Profile Definition
- Use Microsoft SQL Server Enterprise Manager to extend the UserObject table, and then add an attribute. To do so, open the UserObject table in Design mode, and then add the following attribute:
i_requireapproval, varchar 255,allow nulls
For additional information, see the SQL Server documentation. - Add the new data member to the User Object. To do so, select the attribute that you created in step 1 and define it as a string data type.
For information about how to add a new data member, visit the following Microsoft Web site:
- Add a User Site Term attribute:
User Site Term: NeedApproval
Display name: Need Approval
Under Terms, add two terms:
Term Name 1: Display Name No Approval
Term Name 2: Display Name Need Approval
For information about how to add a site term, visit the following Microsoft Web site: - Add an attribute to the User Object\General Information.
- The properties for the new value are:
Name: Need_Approval
Display name: Need Approval
Type: Site Term
Type reference: Need Approval
- Under Advanced Attributes\Map to data, map it to the attribute that you exposed in step 2.
For information about how to add a new property, visit the following Microsoft Web site:
For information about how to add a site term to a profile definition, visit the following Microsoft Web site:
Add a New Data Code
- Add a new data code: Open Business Desk, locate Orders Module\Data Codes. For Code, type 8, for Code Name and Description type Approval.
- Locate Users Module\Publish Profiles, select the correct Web server number, and then click publish changes to production and refresh the cache.
- Use Microsoft SQL Server Enterprise Manager to set one of your users to need approval when the user places orders: Open the UserObject table, locate a user, and then set the i_RequireApproval column to NeedApproval.
NOTE: For an actual site, you have to make modifications to allow a business manager to do this through the user interface.
For additional information, see the SQL Server documentation.
Make the ASP Code Changes
NOTE: This procedure is based on the use of the Retail solution site.
- Add the following code to the SaveBasketAsOrder function, which is located in Inetpub\wwwroot\retail\include\Payment.asp\:
'Checks to see if the user needs approval and if it does, sets the order status code to "5"
If mscsUserProfile.GeneralInfo.Need_Approval.Value <> "1"
Then
mscsOrderGrp.Value("order_status_code") = 8
End If
- Add the following code to the GetOrderFormData function, which is located in Inetpub\retailbizdesk\orders\orderstatus_view.asp\:
If Request.Form("update")="true"
Then
With g_oOrderGroup.value("order_status_code")=Request.Form("order_status_code").saveasorder
End With
End If
- Replace the following code in the GetXMLOrderSummaryData function, which is located in Inetpub\retailbizdesk\orders\orderstatus_view.asp\:
Existing code:
sBuffer = sBuffer & "<order_status_code>" & g_MSCSAppConfig.DecodeStatusCode(g_oOrderGroup.Value("order_status_code")) & "</order_status_code>"
New code:
sBuffer = sBuffer & "<order_status_code>" & g_oOrderGroup.Value("order_status_code") &"</order_status_code>"
Make the XML Code Changes
- Add the following code to Inetpub\retailbizdesk\config\Orders.xml. To do so, use the Find command on Taskback.gif, and then place the following code after the lines of code that are related to the <taskback> element:
task icon='tasksaveback.gif' id='saveback'>
<postto action='orders/orderstatus_view.asp' formname='saveform' />
<name>Bac<U>k</U></name>
<key>k</key>
<tooltip>Save Order Status and back to Order Status List</tooltip>
</task>
<task icon='tasksave.gif' id='save'>
<postto action='orders/orderstatus_view.asp' formname='saveform' />
<name><U>S</U>ave</name>
<key>s</key>
<tooltip>Save Order Status</tooltip>
Restart Internet Information Services
To restart Internet Information Services, click
Start, click
Run, and then type
iisreset.
Log On with the Modified User
Log on with the user profile that you have modified to required approval for order placement.
Complete a purchase and verify that the user's order status is set to
Approval by selecting
Orders in the Customer Service module.
To display the new order, open your Business Desk, locate Orders Module\Order Status to display the new order. The order status should display
Approval. To modify the order status, select and open the order status.