Notifications

19 views

Issue

Description

This article describes how to exclude a Catalog Item from appearing in the Popular Items on the Service Portal.

Procedure

The functionality that retrieves the Popular Items resides within the SC Category Page [sc-category] widget. Within the server script of this widget is the "getPopularItems" function where the query is built. To have the ability to exclude items from the list of items returned from this query a new boolean field would need to be created for the Catalog Item [sc_cat_item] table. You will then need to clone the SC Category Page [sc-category] widget and add the new field to the query.

As an example let's say we create a new field named "Exclude from Popular items [u_exclude_from_pop_items]" and this field is set to "false" by default. Any catalog items that you would like to exclude would need this field value changed to "true". After cloning the widget we will need to modify the "count" variable created on line 164* (and redefined for record producers on line 191*) in the server script that holds the query by adding the following:
[code]<code>count.addQuery('u_exclude_from_pop_items',false);</code>[/code]

Once the cloned widget has been updated switch the OOB version for the custom version.

*Line numbers provided refer to Madrid release version of the SC Category Page [sc-category] widget 

Applicable Versions

Any supported release (Madrid, London and Kingston as of this writing)

 

Article Information

Last Updated:2019-08-02 20:41:07
Published:2019-06-05