- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 12:42 PM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 02:55 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2020 11:43 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2020 12:17 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2020 12:46 PM
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.