I have added a Scriptor Component in the Total Pipeline for Freight Charges.
How can I return an error back to the user if for instance that the Shipping Method / Service is invalid.
Any code sniglets would be greatly appreciated.
Please Advise.
I have added a Scriptor Component in the Total Pipeline for Freight Charges.
How can I return an error back to the user if for instance that the Shipping Method / Service is invalid.
Any code sniglets would be greatly appreciated.
Please Advise.
Total Pipeline
Malay Thakershi
Xcel,
I believe the most common practice for returning errors is adding an entry to the _basket_errors or _purchase_errors collections. David Messner describes some "best practices" for this on his BLOG:
http://blogs.msdn.com/davidme/archive/2006/03/06/transactional-pipeline-components-and-error-handling.aspx
Unfortunately, I haven't ever worked with these two lists from within a scriptor component, so I don't have any code snippets for you. Keep in mind that pipeline scriptors are only supposed to be used in a development environment, so you're going to want to code all of this as custom pipeline components when you move to production, and I think there are some snippets available for using these collections from pipeline components.
bes7252
Thank You for the response.
Can I get a code sniglet of putting an error message into the errors collection.
Also will the starter site handle showing this message to the user - which would be preferable.
Chris...
Dark Pontiac
I would suggest returning a warning from the component. Also you can add the warning message in the _basket_errors or _purchase_errors collection.
function mscsexecute(config, orderform, context, flags)
//Put your component logic here.
if(SUCCEEDED)
mscsexecute = 1
else
//Put the warning message in the orderform dictionary in _basket_errors or _purchase_errors collection
mscsexecute=2
end function