- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 10:50 PM
We have manually created a widget to display the most recent catalog items. We would like to add the request and favorite icons as in the out-of-the-box "Recommended for You" widget into our custom widget. How can we achieve that functionality.
Attaching screenshot for the reference.
Thanks for any help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2024 05:10 AM - edited 11-12-2024 05:19 AM
Hello @Shashank_sj10
You can look for fa icons to add it in this way.
<span class="fa icon fa-heart" ng-class="data.favoriteIcon"></span>
//to add colour
span.fa.icon.fa-heart {
color: red;
}
Please refer the link and look for the desired bootstrap icon.
"If you found my answer helpful, please like and mark it as the "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2024 04:47 AM
Hello @Shashank_sj10
Good to hear that answer helped you!
Now to add the favourite widget to a custom widget
- Get the sys_id of catalog item -> server script
data.itemSysId = $sp.getParameter('sys_id')
This will fetch the sys_id from url
- Add the favourite widget in custom widget
<div>
<!-- Your custom widget code here -->
<!-- Include the favorite widget, pass sys_id of catalog item -->
<sp-widget widget="favorite" options="{ 'sys_id': itemSysId }"></sp-widget>
</div>
Note: The custom favourite widget will contain the functionality to add the catalog in favourite page.
Additionally I would suggest to clone the ootb widget if similar functionality is required and then customize it. This is reduce the development time. Refer ootb widget 'ec_favorite'.
"If you found my answer helpful, please like and mark it as the "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2024 05:07 AM
Thanks for the quick response. I tried this but its not working as expected we are not able to see the favorite icon on the UI of the widget.
Can you brief more about the process it would be helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 12:32 AM
You may find this section of product documentation helpful:
Configure favorites: Explains how to configure favorites and other related information.