
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 08:52 AM
Hi guys,
I have this requirement that when the cart is empty it is hidden in the header menu and if it has some items it needs to be visible. I've already done this with a query to the sc_cart_item table and added a check variable in the html tag of the header widget. However, the requirement is to toggle the option dynamically, that is, when the user clicks on the button add to cart button, the menu option should pop up automatically.
Anyone knows how to achieve this without cloning the sc catalog item widget?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 10:25 AM
Hello,
No for that as well we need to update the client controller of the widget itself it would not be possible.
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 08:57 AM
Hello,
Do you mean that the option should be visible when some clicks add to cart and other times it should be hidden?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 08:59 AM
It should be visible only when the cart has items, otherwise it needs to be hidden.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 09:06 AM
Hello,
I see so unfortunately that would not be possible with the OOB setup.
The only possible way is to clone and customize sc catalog item widget but I believe that too will be a bit of work. Plus customizing such a important widget is not recommended as ServiceNow my bring in new features in the future.
Please mark my answer as correct based on Impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 09:20 AM
Thanks Saurav. Yes, it needs to be cloned, and I don't want that exactly because of that, it's a important widget.
Do you know if I can refresh the page from the Header widget? Like when an item is inserted in the cart, it reloads the page. Because I already have this more or less working, but it needs to reload, that is, when the user inserts an item to the cart and reloads the page the cart appear.