How to skip the two step checkout when using sn_sc.CartJS()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 12:17 AM
Hi,
The below script is working fine when I set the following properties as false the (glide.sc.checkout.twostep)
But i don't want to set the properties to false and also the below script should work. can you help me how to skip the two-step checkout when using sn_sc.CartJS()
createItem: function(current) {
var data = JSON.parse(current.variables.test_variable);
for (var i = 0; i < data.length; i++) {
var dataSet = {};
dataSet.requested_for = data[i].requested_for.toString();
dataSet.name = data[i].name.toString();
dataSet.number = data[i].number.toString();
var arraydata = '[' + JSON.stringify(dataSet) + ']';
var approver = this.getManager(data[i].requested_for);
gs.info("approver==" + arraydata);
var cart = new sn_sc.CartJS();
var item = {
'sysparm_id': '1aa391712fb2011009d159ab2799b676',
'sysparm_quantity': '1',
'get_portal_messages': true,
'variables': {
'parent': 'No',
'approver': approver.toString(),
'company': current.variables.company.toString(),
'test_variable': arraydata
}
};
var cartDetails = cart.addToCart(item);
var checkoutInfo = cart.checkoutCart();
}
},
Thanks
Labels:
2 REPLIES 2

Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 12:22 AM
Hi
Here are few threads which will help you:
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 01:18 AM
Hi, Can you help me how to user this script in my above function
Thanks