Possible to hide from popular items in SP?

John Vo1
Tera Guru

Is it possible to hide a popular item from popping up here?  So if I don't want apple ipad 3 to not show up in the popular item is it possible?

find_real_file.png

1 ACCEPTED SOLUTION

rajneeshbaranwa
Giga Guru

Best Practice would be to create a system property and store comma separated sys_id values of the to be hidden catalog items in this property.

 

Then you can add below one line of the code in Server Script of cloned widget. That is it. You are set.

Next time when you are asked to again exclude/include another catalog item , You just need to add sys_id of the catalog items in the property. No code change required. 

 

find_real_file.png

View solution in original post

47 REPLIES 47

John Vo1
Tera Guru

So I went with rajneeshbaranwal way to creating sys properties so it would be easier to add or remove.

And added his code to hide by looking at the system property.

count.addQuery('cat_item.sys_id', 'NOT IN',gs.getProperty('sc_exclude_popular_items'));

 

Jaspal, help me with hiding create an incident with this code.

count.addEncodedQuery('producer!=c49e04981b5bc0508c8b42eddc4bcb85');

 

Mark also gave me ideas on what to do.  Is there a way to mark couple answers as correct?   Thank you Mark, Jaspal and Rajneesh for your help on this.  

 


In addition to this, I believe best practice would be to create two properties one for storing excluded catalog item and one for record producer and use them in your gliderecord queries

 

Hopefully you are learning a lot in the forum

brendanhamman
Giga Contributor

 

For those of you like me, that only need to hide items that are added just for use in order guides - see the below:

count.addQuery('cat_item.visible_standalone','true');

I added a form section for my current client so we can use these fields on the form, as there are a lot of catalog items we add to order guides that we don't want shown in the popular items.