How to edit add to cart button in service portal?

Rinty
Giga Contributor

In service portal, when I click on "add to cart" button, it gives me two option. one is "Catalog Home" and another is "View Cart". I want to take off "Catalog Home" button and put another button in there called "Continue shopping" which will redirect user to the sc_cat_item_guide. Can someone please help me with that?

Clear instruction with steps please. I am not familiar with service now.

Thank you!

1 ACCEPTED SOLUTION

Rinty
Giga Contributor

Oleg,

I have done this and still it's not mapping to the sc_cat_item_guide. Can you please help me with it? 

 


spModal.open({
      message: i18n.getMessage('Items have been added successfully'),
      size: 'sm',
      backdrop: 'static',
      keyboard: false,
      noDismiss: true,
      buttons: [
         {label: i18n.getMessage('Continue Shopping'), cancel:true},
         {label: i18n.getMessage('View Cart'), primary:true}
       ]
           }).then(function() {
               $location.search("id=sc_cart");
           }, function() {
           $location.search("id=sc_cat_item_guide");
              })

           });
   }

View solution in original post

10 REPLIES 10

Dhananjay Pawar
Kilo Sage

Hello Rinty

Try this it will may help you to get what you are looking for

System UI > Messages - search key for Add to Cart. Change the message as necessary.

If you like my answer please mark it as Helpful and correct.

Thanks,

Dhananjay.

Hello Dhananjay,

This will only allow to change the name of the button. I need to change the function of the button. 

Thanks,

Rinty

Thank YOU 

Dhananjay
 

Oleg
Mega Sage

It seems that you use the page sc_cat_item_guide with SC Order Guide instead of SC Order Guide Deprecated used before. To solve the problem you need to clone SC Order Guide [widget-sc-order-guide-v2] widget and modify the code of Client Controller based on your requirements. Finally, one should modify the sc_cat_item_guide page to used cloned and modified version instead of the original SC Order Guide [widget-sc-order-guide-v2] widget.

The following code (lines 382-396 of Madrid version Patch 4 or 157-171 of London version Patch 😎 displays the Dialog, which you want to modify:

spModal.open({
	message: i18n.getMessage('Items have been added successfully'),
	size: 'sm',
	backdrop: 'static',
	keyboard: false,
	noDismiss: true,
	buttons: [
		{ label: i18n.getMessage('Catalog Home'), cancel: true },
		{ label: i18n.getMessage('View Cart'), primary: true }
	]
}).then(function() {
		$location.search("id=sc_cart");
	}, function() {
		$location.search("id=sc_home");
	});

The most options of spModal are described in ServiceNow documentation here.