The CreatorCon Call for Content is officially open! Get started here.

Displaying a catalog item's variables' value in the shopping cart

rahul_
Giga Contributor

Hi All,

I have a requirement of adding a variable onto the shopping cart layout. I've looked into the the sc_cart_items_price_quantity macro where I'd want to bring in my variable right after the catalog item's name.
But being no expert in jelly script, I'm not sure how the OOB script is fetching the cart items into it. I tried to modify it by getting the expected variable's value into the script but am unsure about syncing the loop between the OOB script items=${jvar_cart_items} and mine, br.next() as highlighted in the screen shot. The code between the highlighted lines is something that I've added to the OOB also the display output line at the end. The output is the other attached screenshot. Since am not getting the sync between the loops, am able to show only one value being repeated(Same value in the cart) for the other catalog item in the cart too.

Any help is highly appreciated. 

Thanks in Advance,

Rahul.

 



find_real_file.png

find_real_file.png

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Rahul,

Are you trying to display catalog variable values for multiple RITMs on the right hand side?

Also is your current code only displaying it for same RITM twice?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Thanks for the response.

Yes, am trying to populate the variable value in the cart along with the catalog item name.

But am not able to get the loop exactly in the Jelly script and for that reason I'm only able to populate the same value repeatedly for different RITMs.