- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 04:34 PM
I'm trying to add a new check box field to the Istanbul Service Portal Shopping Cart, with the ultimate goal of the true/false value making its way to the Request, but, I'm stuck.
What I've done so far:
- I've created the appropriate column on sc_request
- I've modified the 'large_shopping_cart.html' Angular ng-template to get the appropriate field on the Portal page
- I've modified the 'SC Shopping Cart' Widget Server Script and Client Controller so that everything is processed properly. I've logged what is being returned on submit, so I know we're working up until this point.
This is where things get a little fuzzy for me. From what I can tell, the 'SPCart' Script Include is called from the widget and all the appropriate data is sent on it's way. But I don't know what to do from here?
Has anyone done something similar on the Portal Shopping Cart that can point me in the right direction?
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 01:29 PM
I just completed adding a few fields to the Service Portal shopping cart. From what I can tell that is part of the backend process that we do not have access to. I ended up creating a new Script Includes with my logic and inherited the SPCart script.
One thing I was held up on, I have minimal knowledge of the shopping cart structure, you must add whatever fields you are wanting to both the sc_request and the sc_cart tables. Then I just used this article for the cartpop since I was adding more than one new field.
There may be an easier/new way to do it with the Service Portal but I haven't seen any documentation.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 07:57 AM
You can find it in script include. Search SPcart.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 08:34 AM
Thanks Harish I found SPCart. I have another question I found Requested For, Delivery Address, and Special Instructions they all point to sc_request I want to point these fields to a different table is there a way possible I can do that. I found this code in the SPCart script. Is there a way I can modify the code below.
SPCart.prototype.setDeliveryAddress = function(deliveryAddress) {
var cart = GlideappCart.getCartForRhino(this.cartName, this.userID);
cart.setDeliveryAddress(deliveryAddress);
};
SPCart.prototype.setSpecialInstructions = function(specialInstructions) {
var cart = GlideappCart.getCartForRhino(this.cartName, this.userID);
cart.setSpecialInstructions(specialInstructions);
};
SPCart.prototype.setRequestedFor = function(requestedFor) {
var cart = GlideappCart.getCartForRhino(this.cartName, this.userID);
var cartGR = cart.getGlideRecord();
cartGR.setValue("requested_for", requestedFor);
cartGR.update();
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 08:37 AM
You cannot modify this code. As servicenow does not provide documentation
related to GlideCart which is used in that script include.
Alternate way would be modifying the cart widget.
On 31 Oct 2017 11:34 pm, "patwheat" <community-no-reply@servicenow.com>
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 09:10 AM
Okay to modify the shopping cart I have input field that I need to add if I want to submit my new input fields to a different table is there an article I can follow or could you help me Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 09:15 AM