How to Remove the Shopping Cart Delete Item Confirmation

Geoffrey Bishop
Tera Contributor

In the Service Catalog Shopping Cart, if the user clicks the X button next to one of the items, a Popup Dialog magically appears.  We would like to remove this confirmation step, and have the cart just go ahead and delete the item.  Could someone with good Service Portal skills possibly show me how to go about doing that?  Thanks!!

 

1.png

 

6 REPLIES 6

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

there is a widget named "SC Shopping Cart" which gives this message.

 

You will have to clone this widget and modify the server script to get rid of this confirmation step:-

 

Saurav11_0-1665078047275.png

 

Please mark answer correct/helpful based on Impact.

Thanks @Saurav11 , I did see that widget earlier.  But what line of code is actually invoking the confirmation dialog?  Line 2 in your screenshot is only setting a message variable.

The dialog is invoked either by confirm(dialogMsg) on line 215 or by spModal.confirm(dialogMsg) on line 227 inside the "c.removeItem" function defined in the "Client controller" script.

Hello,

 

Yes as mentioned by Slava the line 206 has a function named c.removeItem() which had the control of the dialog box. 

 

Saurav11_0-1665208358633.png

 

Just make sure when you remove the dialog boxes you still need to have the code which triggers the removal of the items. So you just need to remove the dialog part only rest of the code is still needed.

 

Please mark answer correct/helpful based on Impact.