Stop a Catalog Item from redirecting to the request

Joseph Navarro1
Tera Contributor

Hello, we have a new catalog item we are trying to implement in production. However, when activated, the "submit" button redirects the customer to the associated request instead of the portal homepage. Where should I check to fix this issue?

1 ACCEPTED SOLUTION

Sohithanjan G
Kilo Sage
Kilo Sage

Hi @Joseph Navarro1 

This can be done effectively by creating a new widget & embedding sc_cat_item into it. But in the client side of the new widget, you can do your manipulation of redirecting. Here's new widget looks like

HTML

<div>
  <sp-widget widget="data.catItemWidget"></sp-widget>
</div>

 

Client Side: 

function($scope, $location,$timeout,spUtil) {
	/* widget controller */
	var c = this;
	
	$scope.$on("$sp.sc_cat_item.submitted", function(event, data){	
			$location.search("id="+ 'page_name'); // mention the required home page
	});
}

 

Server Side: 

(function() {
	/* populate the 'data' object */
	/* e.g., data.table = $sp.getValue('table'); */
	var properties = {};
	properties.show_add_cart_button = "false";
	properties.auto_redirect = "false";

	data.catItemWidget = $sp.getWidget("widget-sc-cat-item-v2", properties);
})();

 

This would work effectively and it will not impact the upgrades too. 

Please mark as Accepted Solution & Hit helpful button 🙂

 

 

BR, Sohith

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

View solution in original post

4 REPLIES 4

Badal Khojare
Mega Sage
Mega Sage

Hi @Joseph Navarro1 , 

After submitting the catalog item , it is redirected to request summary page. You can check this link and modify as per your requirement: https://www.servicenow.com/community/itsm-articles/redirect-to-requested-item-ritm/ta-p/2300997

 

Please Mark My Response as Correct/Helpful if it helped.
Regards,
Badal Khojare
Community Rising Star 2023

Hello @Badal Khojare,

Thank you for your reply. However, the catalog item is not exhibiting this behavior in our Dev or Test environments. In those environments, the catalog item is properly returning to the homepage.

Thank you,

Joseph Navarro

Sohithanjan G
Kilo Sage
Kilo Sage

Hi @Joseph Navarro1 

This can be done effectively by creating a new widget & embedding sc_cat_item into it. But in the client side of the new widget, you can do your manipulation of redirecting. Here's new widget looks like

HTML

<div>
  <sp-widget widget="data.catItemWidget"></sp-widget>
</div>

 

Client Side: 

function($scope, $location,$timeout,spUtil) {
	/* widget controller */
	var c = this;
	
	$scope.$on("$sp.sc_cat_item.submitted", function(event, data){	
			$location.search("id="+ 'page_name'); // mention the required home page
	});
}

 

Server Side: 

(function() {
	/* populate the 'data' object */
	/* e.g., data.table = $sp.getValue('table'); */
	var properties = {};
	properties.show_add_cart_button = "false";
	properties.auto_redirect = "false";

	data.catItemWidget = $sp.getWidget("widget-sc-cat-item-v2", properties);
})();

 

This would work effectively and it will not impact the upgrades too. 

Please mark as Accepted Solution & Hit helpful button 🙂

 

 

BR, Sohith

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

Shubhangi Gopha
Tera Contributor

Did you get this working , if so could you please share the code