To populate variables in the shopping cart widget from catalog item

diNesh_M
Tera Contributor

Hi community, 

I'm working on the Service Portal for my organization and they would like to see some variable fields in in the SC Shopping Cart widget. The widget is using the large_shopping_cart template and by default and it only  displays the Item , quantity . We would like to have the Requested For (variable in the form) value be added to it as well .

I have already referred few community links but no luck .

I have already made changes in the SPCart script includes and able to get the value of Requested for but the problem is i could not figure out how to write a script in the Angular ng-template to make the Requested for value getting filled in the shopping cart.

Have attached screenshot below.

Kindly refer screenshots and recommend to do the  needful.

Thanks

10 REPLIES 10

SC Shopping Cart
It should be here, get the requested for in data.item variable and then only you can get it in template.


Thanks and Regards,

Saurabh Gupta

@Saurabh Gupta 

Hi Saurabh,

Thank you for instant response.

You mean i have make changes in the HTML template first and then call in ng-template ,i am not getting it exactly.

Can you kindly share me the code and where to use it exactly.

 

Thanks

Hi,
You need to change the server script of your widget and add the value of requested for into the 

data.cartItems.

Thanks and Regards,

Saurabh Gupta

@Saurabh Gupta  

 

I have already written a server script in SPCart script includes to get the value of Requested for variable ,you want me to write the same script in widget server script ?

And if so how to call it in the HTML template?

Can u elaborate me on this with script ?

 

Thanks

@Saurabh Gupta 

 

Hi Saurabh,

I have written the script in the server script of the shopping cart widget but facing difficulty to match the sys_id of the current catalog item available in the cart.

Only if i match the sys_id of present catalog item in cart with the "cart_item" field i will be able to proceed further .

Can u provide your input on this ?

I have pasted the screenshot below.

Thanks