- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 01:27 PM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2023 11:57 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 01:44 PM
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
Regards,
Badal Khojare
Community Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 10:42 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2023 11:57 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2023 07:16 PM
Did you get this working , if so could you please share the code