- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 02:44 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 06:48 AM
Hello @shrinivasprasa1
- Please download the customized widget XML attached here and import it in to your instance.
- From All Menu Search for Widgets and then open Service Portal -> Widgets
- 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.
- Now Open any catalog Item in Portal and press Ctrl + Right Click on any field then select Open Page in Designer.
- In the designer, delete the SC Catalog Item Widget and the SC Catalog item Widget.
- 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 😀
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 03:39 AM
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.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 04:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 05:20 AM
Hi @AnveshKumar M ,
Waiting for you reply kindly provide me the solution.
Approciated for quick response.
Thanks,
Shrinivasprasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 06:48 AM
Hello @shrinivasprasa1
- Please download the customized widget XML attached here and import it in to your instance.
- From All Menu Search for Widgets and then open Service Portal -> Widgets
- 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.
- Now Open any catalog Item in Portal and press Ctrl + Right Click on any field then select Open Page in Designer.
- In the designer, delete the SC Catalog Item Widget and the SC Catalog item Widget.
- 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 😀
Anvesh