Recent and Popular Item widget showing IT catalog items in ESC portal

Harshita Omer1
Tera Contributor

Hi All,

 

In my ESC portal > Recent and Popular Item section showing me the catalogs item from IT portal. Therefore I have cloned the widget and made the changes to show the catalog items from HR in My Recent Item, but I am not able to do the same for Popular Item section. 

The Popular Item is calling a separate script include (SCPopularItems) which is fetching the data to display from 'catalog_channel_analytics' table. Currently, it is displaying the data from HR Service Catalog as well as from IT Service Catalog. 

 

I have tried few ways to do it, but not able to achieve the required result. Can you please help here. 

Thanks in Advance! 

 

Widget > Server Script for Popular Item: 

data.popularItems = getPopularItems();
 
function getPopularItems() {
        return new SCPopularItems().useOptimisedQuery(gs.getProperty('glide.sc.portal.popular_items.optimize', true) + '' == 'true')
            .baseQuery(options.popular_items_created + '')
            .allowedItems($sp.getAllowedItems())
            .visibleStandalone(true)
            .visibleServicePortal(true)
            .itemsLimit(options.limit || 😎
.restrictedItemTypes(['sc_cat_item_guide', 'sc_cat_item_wizard', 'sc_cat_item_content', 'sc_cat_item_producer'])
            .itemValidator(function(item, itemDetails) {
                if (!item.canView(gs.isMobile()) || !item.isVisibleServicePortal())
                    return false;
 
                return true;
            })
            .responseObjectFormatter(function(item, itemType, itemCount) {
return {
order: 0 - itemCount,
name: item.name,
short_description: item.short_description,
picture: item.picture,
price: item.price,
sys_id: item.sys_id,
hasPrice: item.price != 0,
page: itemType == 'sc_cat_item_guide' ? 'sc_cat_item_guide' : 'sc_cat_item'
};
 
            })
            .generate();
    }

 

 

3 REPLIES 3

Susan Britt
Mega Sage
Mega Sage

The widget instance options has a box to select if you want to include Record Producers. Do you have this checked as true?  It will be required to pull in your HR items.

Hi Susan,

 

We would like to show the Record producers but only from HR catalog not from SP catalog

 

Regards,

Har**bleep**a

Har**bleep**a,

did you find a solution for this?

We are facing similar issue.

Regards

Dan