- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2017 01:51 PM
I'm looking for a way to have an automatic cache out and empty of the cart when an order guide is opened to eliminate the possibility of old or "unchecked out" items being in the cart when the "checkout" page within the Order Guide is reached.
is this possible? thanks!
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 04:33 PM
Patrick, here you go. please mark as correct. also, check impersonating a user with no role.
onLoad client script:
function onLoad() {
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('CartUtil');
ga.addParam('sysparm_name', 'clearCart');
ga.getXMLWait();
}
script include:
var CartUtil = Class.create();
CartUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
clearCart: function() {
var clear = new GlideRecord('sc_cart_item');
clear.addQuery('cart.user', gs.getUserID());
clear.addQuery('active', 'true');
clear.query();
clear.deleteMultiple();
return;
}
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2017 09:42 AM
great thanks Dan!