简体   繁体   中英

Displaying Errors on Scriptable Cart

I am trying to prevent a sales order from being created when conditions are met regarding items in a customers cart on a SuiteCommerce Advanced site using the Scriptable Cart.

I'm using a User Event and nlapiCreateError() to send the error but the Sales Order goes through anyway and the error is only displayed in the execution log in NS. Is there a way to display the error on the SCA site and prevent the Sales Order from being created?

Scriptable Cart scripts are client scripts.

The easiest way (IMO) to make them work is to create them as a deployed client script rather than to attach one to your store's transaction form.

You also have to check "Scriptable Cart and Checkout" on your store's setup page.

Note this follows Client Script semantics not User Event Script semantics.

When your error is thrown it should be caught by the add to cart .ssp script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM