Displaying a catalog item's variables' value in the shopping cart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2018 02:53 PM
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.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2018 09:24 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2018 06:49 AM
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.