How to dynamically redirect users to Requested Item page instead of SC Order Status page?

Kevin4
Tera Contributor

My goal is the following: When a user requests one item from the Portal (just one). OOB the user is being send to the widget SC Order Status to follow the state of the Request. The user has the opportunity to click on the requested item to see more details about the request.

What I am trying to reach is, when the user only has one requested item, I don't want to fully load the SC Order Status widget. But instead load the the page where the user sees hers Requested Item (sc req item widget). So if there is only one requested item according the request, don't load the SC Order Status widget.

Why I want this? I don't want to change to many OOB widgets and pages. So I tried to redirect the user when the request only contains one requested item. And came up with several solutions on the Client Script side, but I really need a solutions on the Server Script side. So the preload time for the browser is at the minimum. Also the suggestion to use a Processor, but that one is deprecated. Also the Page Route Maps doesn't have the proper solution to fulfill my wish.

Does someone experience the same issue and does have a simple solution for it?

5 REPLIES 5

Raslani1
Kilo Expert

Hello,

I was about to suggest you to (clone and) modify the widget, but if you don't want to change OOB widgets.

There's no other way to achieve your need (as far as I know) due to the fact tthat you are talking about 'conditions'. Redirect if one RITM and not if more means that you will need to script that behaviour.

OOTB, the redirection after sumbit is done through this $location.search('id=sc_request&is_new_order=true&table=sc_request&sys_id=' + a.sys_id) in the  "SC Catalog Item" widget (client script tab). You can add here your logic and redirect to ?id=ticket&table=sc_req_item&sys_id , and also in the cart widget with an if and else condition.

 

Regards,

raslani

I agree, you'll need to clone and modify the widget. If you decide to go this route, the Catalog Checkout widget uses data.numberOfCartItems, which you can leverage in your condition

Kevin4
Tera Contributor

Thanks for your reply. Well I don't want to clone to much. So that why I was trying to manipulate the SC Order Status Widget to do some routing. If there is only one RITM, go there instead, otherwise stay on the page. If I can manage that, I don't have to change the redirection after a submit for example.

Joyce W
Giga Expert

I have done redirect but not dependent on specific count of an item, using Page Route Maps. That could be an alternative but it affects all items whether the count is one item or more than one. The Route to page holds the widget that gives your desired results.

find_real_file.png