Order Confirmation popup on cart v2 -how to edit

Les1
Tera Guru

This pertains to the two step checkout process in service portal which popups an Order Confirmation.  We want to hide the Requested For field but still include the Deliver & Special instructions.

i've been spending a fair time looking at other community posts and trying to nail this down and it still eludes me.

find_real_file.pngi want to hide the Requested for from displaying. 

realizing this will likely take some widget clone and editing i've proceeded that route. 

I found the widget "Catalog Checkout" and cloned and edited the HTML body to remove the HTML reference to Requested for thinking this would be enough to prevent it from displaying.

However to actually install this meant also clone & editing  the sc-shopping-cart-v2 widget so that i could then edit the server script so that where:

if (localInput && localInput.action === "checkout_two") {
data.checkoutCartModal = $sp.getWidget('widget-modal', {
embeddedWidgetId: 'sc-catalog_checkout',   -----> edited it to point to my new catalog checkout widget.

I then when to page designer and edited the Shopping Cart (sc-cart) page so that Instance 1 pointed to my updated shopping cart page which used the updated checkout.   

 

and still with all of the above, when i click ORDER  on the service portal it still shows the "requested for" in the popup!  😮

hopefully someone can point me in the right direction of where i might be missing something or simply tell me the most direct way to handle the requirement.  Thanks!!!!!!!

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

This doesn't look configurable to me if I look at the widgets. Unfortunately, like you already mentioned, if going for the widgets, you need to clone them.

First widget is the SC Catalog Item widget [widget-sc-cat-item-v2]. This actually calls another widget: sc-checkout. So you need to clone 2 widgets.

See below steps (= tested).

find_real_file.png

find_real_file.png

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

15 REPLIES 15

Hi Mark,

 

I followed your exact steps and the widget works correctly when its run through SC Catalog Item. 

 

We have some tasks that are being run through the HR portal as a part of Request onboarding lifecycle event. The widget that is running is HRJ task list. When our catalog tasks run through the HRJ task list, the OOB Catalog checkout widget is still being called. Do you have any insight on how we can call our new Catalog Checkout/SC Catalog item from the HRJ Task List widget?

 

Thank you,

Wes

Hey Mark, didnt have a chance to try out your approach but with your screencaps you verified the results for me thank you.

we have opted to not utilize the popup at all due to other hurdles that outweighed the value for having it due to how the order guide we are applying it to works (or, cough, doesnt work). Sometimes we just have to make the best with what we have! 🙂 thanks!

Hi Mark,

This solved part of our issue.  However, if the Requested For is hidden, the Delivery Address is still populated with the Requested For person's address.  How can we blank out the Delivery Address?

I've tried several things in the sc-checkout widget Server script, but no luck.

Any ideas?  We are on Tokyo.

 

Thank you,

Laurie

 

Harsh Vardhan
Giga Patron

may i know why do you want to hide it ?

i am assuming the case here, you have requested for variable available on catalog form and it's not matching with the exact value , if this is the scenario then you can match it and set it. 

 

Sample code to set the requested for value on order confirmation popup. 

 

Write one onChange catalog client script on your Requested for variable. 

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

   var win = (0,eval)(this);
	
	try{
		//get the angular scope
		var thisScope = win.angular.element('#sc_cat_item').scope();
		
		//update the check out options with the value of requested_for
		thisScope.$parent.options.requested_for_display = thisScope.$parent.data.sc_cat_item._fields.<Your requested_for Variable>.displayValue;
		thisScope.$parent.options.requested_for_id      = thisScope.$parent.data.sc_cat_item._fields.<Your requested_for Variable>.value;
		
	}catch(e){console.log('unable to set order dialog value requested_for : '+e);}
}

 

Blog Reference: 

 

https://community.servicenow.com/community?id=community_article&sys_id=ca9ce025db72f340d82ffb2439961...

Yes, thank you for that question, our use case has Requested For on the fulfillment tasks for the order guide request being scripted with a value that is not the logged in user as ServiceNow uses. For us "requested for" is the user that is getting the order which in this case the scenario is an employee onboarding situation. so the logged in user is requesting a User to be onboarded and the requested for is the user being onboarded rather than logged in. 

as time permits i will check out your onchange script and see if i can make that work for this use case so i can avoid all the widget cloning.. .that would be a much easier implementation!

thank you