How to hide a div tag in HTML template of shopping cart widget

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 10:45 AM
Hi Team,
I have a requirement that a particular division tag in HTML template of a widget should be displayed for a particular catalog item called "Whitelist IP".
But for other catalog items the div tag should not be displayed.
I am not sure how to proceed to hide it for all catalog items except one.
Hope some script should be written in div tag of HTML template and in server script of the widget .
Can someone let me know what script can be written to achieve this requirement?,
I will put the screenshot below for better understanding and if any clarification required pls revert ,i will respond.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 11:10 AM
Hello @diNesh_M ,
1) Remove line no 159 in server and in 164 use data.catalogItem instead of catalogItem.
2) Use cartItem.sys_id.toString(); in server script
2). In HTML in ng-if remove c. and just use data.catalogItem and also enclose the sys_id in single quotes like below
ng-if="data.CatalogItem=='your_sys_id'"
Hope this helps
IF it helped you , please mark the answer correct
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 12:56 AM
Hi Mohith Devatte,
Thanks a lot for your response and i tried the changes will you have asked me to do in server side and HTML template and that helped me to hide the div tag for other catalog items except whitelist IP in shopping cart .
But now i am facing another problem like when user click on "Remove item Whitelist IP " ,it only removes that particular item from page but not the div tag which contains the variable requested for .
We need to remove that div tag as well when user clicks on Remove item whitelist ip from cart .
I will paste the screenshot below ,kindly let me now what changes can be done in HTML template to fix this issue .
Thanks in advance