How to redirec to sc_cart page when user click on submit button in employee service centure portal

shrinivasprasa1
Tera Contributor

Hi Community,

 

Good day!!!

 

we have requirement that when user submiting request it should move to sc_cart after that it should sbumit the request, now as per the OOB it is submit the request direct it is not showing cart items.

 

Appriciated for the quick help.

 

Thanks,

Shrinivasprasad

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hello @shrinivasprasa1 

 

  1. Please download the customized widget XML attached here and import it in to your instance.
    1. From All Menu Search for Widgets and then open Service Portal -> Widgets
    2. AnveshKumarM_0-1722519358687.png

       

    3. In the list view opened, right click on table header (any column name) and select Import XML and import the file you downloaded from this article. Please note that I did this Widget in Washington Patch 4 Hotfix 1 Version, your instance should be the same or above version.
  2. Now Open any catalog Item in Portal and press Ctrl + Right Click  on any field then select Open Page in Designer.
  3. In the designer, delete the SC Catalog Item Widget and the SC Catalog item Widget.
  4. AnveshKumarM_1-1722519626448.png

     

  5. Now test it once.

For your reference, the changes I did are,

HTML:

Line Number 146: 

<button sp-ellipsis-tooltip sp-ellipsis-tooltip-title="{{submitButtonMsg}}" ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" ng-disabled="disableControls()" ng-click="triggerAddToCart()" class="btn btn-primary bottom-button-width text-overflow-ellipsis" id="submit-btn" aria-live="assertive">{{submitButtonMsg}}</button>

Line Number 249: 

<button sp-ellipsis-tooltip sp-ellipsis-tooltip-title="{{submitButtonMsg}}" ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" id="submit-btn" ng-disabled="disableControls()" ng-click="triggerAddToCart()" class="btn btn-primary btn-block text-overflow-ellipsis">{{submitButtonMsg}}</button>

 

Line Number 262: 

<button ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" id="submit-btn" ng-disabled="disableControls()" ng-click="triggerAddToCart()" class="btn btn-primary rounded m-l-lg padder-xl">{{submitButtonMsg}}</button>

 

Client Controller: Added following line of script after line number 1212 (addToCart() function).

 

$location.search('id=sc_cart');

 

 

Please test it in your PDI and do the changes accordingly in your Dev instance.

 

Please mark my answer helpful 👍 and accept as a solution ✔️ if it helped 😀

 

Thanks,
Anvesh

View solution in original post

4 REPLIES 4

AnveshKumar M
Tera Sage
Tera Sage

Hi @shrinivasprasa1 

If you are Ok with customizing the Widget which handles the submit action (infact the entire catalog item form), I can provide you the solution.

 

Thanks,
Anvesh

Hello @AnveshKumar M 

 

Yes it is okay, please provide me the solution.

 

Thanks,

Shrinivasprasad

Hi @AnveshKumar M ,

 

Waiting for you reply kindly provide me the solution.

 

Approciated for quick response.

 

Thanks,

Shrinivasprasad

AnveshKumar M
Tera Sage
Tera Sage

Hello @shrinivasprasa1 

 

  1. Please download the customized widget XML attached here and import it in to your instance.
    1. From All Menu Search for Widgets and then open Service Portal -> Widgets
    2. AnveshKumarM_0-1722519358687.png

       

    3. In the list view opened, right click on table header (any column name) and select Import XML and import the file you downloaded from this article. Please note that I did this Widget in Washington Patch 4 Hotfix 1 Version, your instance should be the same or above version.
  2. Now Open any catalog Item in Portal and press Ctrl + Right Click  on any field then select Open Page in Designer.
  3. In the designer, delete the SC Catalog Item Widget and the SC Catalog item Widget.
  4. AnveshKumarM_1-1722519626448.png

     

  5. Now test it once.

For your reference, the changes I did are,

HTML:

Line Number 146: 

<button sp-ellipsis-tooltip sp-ellipsis-tooltip-title="{{submitButtonMsg}}" ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" ng-disabled="disableControls()" ng-click="triggerAddToCart()" class="btn btn-primary bottom-button-width text-overflow-ellipsis" id="submit-btn" aria-live="assertive">{{submitButtonMsg}}</button>

Line Number 249: 

<button sp-ellipsis-tooltip sp-ellipsis-tooltip-title="{{submitButtonMsg}}" ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" id="submit-btn" ng-disabled="disableControls()" ng-click="triggerAddToCart()" class="btn btn-primary btn-block text-overflow-ellipsis">{{submitButtonMsg}}</button>

 

Line Number 262: 

<button ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" id="submit-btn" ng-disabled="disableControls()" ng-click="triggerAddToCart()" class="btn btn-primary rounded m-l-lg padder-xl">{{submitButtonMsg}}</button>

 

Client Controller: Added following line of script after line number 1212 (addToCart() function).

 

$location.search('id=sc_cart');

 

 

Please test it in your PDI and do the changes accordingly in your Dev instance.

 

Please mark my answer helpful 👍 and accept as a solution ✔️ if it helped 😀

 

Thanks,
Anvesh