How to get the current cart in service catalog?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 07:16 AM
Hi, I have been trying to implement a "save catalog offer" functionality and am currently thinking about one of key points:
THe current cart with all contents should be saved for later checkout. This is not a problem generally, but I have one question - what would be the best way to get the record of the current cart open in the service catalog? I have checked the API and there is a getCart() function, which is very nice but has one nasty habit of emptying all contents of the current cart.
I suppose I could write another function that will override the constructor but am a bit stuck how to do it - if anyone has done anything similar, please help
Other way I can think of is to use glide record, but this may not always work. Do you guys know of any other ways to get the current sc_cart record / sys_id from inside a UI Macro? Many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 09:31 AM
I would say check out this post on some possible solutions. The one this directly links to is what i have done in the past to extend cart() and allow me to continue to add to the cart and work around that issue.
Re: How to add to a current cart instead of new cart()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 11:40 PM
Thanks a lot, I will try to extend the base class like in your example.