Service Portal "Cart" Page

arnabbose
Tera Expert

Hello,

In the Checking - Out Shopping Cart of SERVICE PORTAL , only the User's Name comes by default in Requested For field , so it's confusing if we have 2 - 3 users of same name. Also, we cannot browse like in standard service catalog to check user's   details or hover on i icon to know the same in SERVICE PORTAL.

Is there ANY way in which we can add User ID / User Email there for proper identification ?

1 ACCEPTED SOLUTION

krr
Mega Guru

We had the same scenario and to fix this you need to do this



Note: the OOTB widget has a bug unfortunately that doesn't allow you to simply create a new template, I tried. I'll put in a ticket for this since it probably effects more people. The overall issue is that the widget expects the option carttemplate but the widget option is cartTemplate. This appears to be case sensitive, so you can't just create a new template and i don't want to edit the OOTB widgets in case we need to revert some time.



Clone the widget and fix a bug


  • Clone the SC Shopping Cart widget to My SC Shopping Cart
  • Click the hamburger menu (the 3 horizontal lines in the top right)
  • Click Edit option schema
  • Change Name
    • From: cartTemplate
    • To: carttemplate


Copy the template


  • Go to the Widget list in the platform (not the widget editor)
  • Open the SC Shopping Cart widget (not the cloned one)
  • Scroll to the bottom to the Angular ng-templates tab
  • Open large_shopping_cart.html
  • Change these properties
    • ID: my_large_shopping_cart.html
    • Widget: My SC Shopping Cart
  • Right click the header and choose Insert and Stay to copy this to your cloned widget.


Update the template



Inside the Template code of your now copied template, scroll down until you find this code



<label>${Requested For}</label>


<sn-record-picker field="c.requestedFor" table="'sys_user'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" ></sn-record-picker>



Change the sn-record-picker to this to show the name and their user name.



<sn-record-picker field="c.requestedFor" table="'sys_user'" display-field="'name'" display-fields="'user_name'" value-field="'sys_id'" search-fields="'name,user_name'" page-size="100" ></sn-record-picker>



In particular you can play with display-fields, this will show the values below the name in the list as you type. You can try to mess with the values, it will hold more than one options If I recall.



Update the cart page


  • Open the Page designer
  • Choose the Shopping Cart [sc_cart] page
  • Delete the SC Shopping Cart widget
  • Add your newly created My SC Shopping Cart widget
  • Click the Pencil icon to edit the options
  • Under Cart Template, enter my_large_shopping_cart.html


This will use your new shopping cart template


View solution in original post

15 REPLIES 15

I created the new template by Insert n Stay on the Original One and added it to by Widget.




find_real_file.png



Added Cart Template on my Custom Widget


find_real_file.png




Yet I find name only



find_real_file.png


Below is template modified



<label>${Requested For}</label>


                  <sn-record-picker field="c.requestedFor" table="'sys_user'" display-field="'name'" display-fields="'user_name'" value-field="'sys_id'" search-fields="'name,user_name'" page-size="100" ></sn-record-picker>


Its Done, Thanks!


Sorry, just got back to a computer. Glad you got it working. Let me know if something is amiss


vinothkumar
Tera Guru

Hi Every one,



I want to show something like this in our Service portal check out screen and I tried adding under display field to include user ID and Email with no luck.



Can anyone help me on this to achieve this?



find_real_file.png