Customer Portal

Get Involved. Join the Conversation.

Topic

    Janusz Jasinski
    Exclude or include certain category IDs in...Answered
    Topic posted January 25, 2019 by Janusz JasinskiBronze Crown: 15,000+ Points 
    98 Views, 12 Comments
    Title:
    Exclude or include certain category IDs in ProductCategoryInput
    Content:

    Hi,

    As the title suggests, how would I exclude category IDs or exclude them with the ProductCategoryInput widget?

    I've extended it but can't see a way to do this. There's only one level of categories I am dealing with.

    Thanks,

    Best Comment

    Janusz Jasinski

    So, this seems to work in manipulating the variable $this but all the categories still show *and also* after extending the widget *just* with the logic.js file, the design is all out of shape and looks entirely different to the original - why is this?

    var listToDelete = [741,613,635,620,614,71,730,630,619,618,621,631,628,629,634,732,632,624,727,627,633,625,626,];
    var a = this.data.js.link_map;
    for (var i = 0; i < this.data.js.link_map[0].length; i++) {
    var obj = this.data.js.link_map[0][i];
    if (listToDelete.indexOf(obj.id) !== -1) {
    this.data.js.link_map[0].splice(i, 1);
    i--;
    }
    }

    Comment

     

    • Justin

      in the console uncheck the 'End User' box for the prod/cat you dont want visible on the portal 

    • Justin

      see screenshot

    • Janusz Jasinski

      We found this stops knowledge from working if an answer is in that category and if we have a custom form using that category, the form will not act as needed

    • Kesava Kumar

      Hi Janusz,

      I found a post something related to your requirement, please find below link it may helps you.

      https://cloudcustomerconnect.oracle.com/posts/82c5641daf

      Thanks & regards

      Kesava

    • Janusz Jasinski

      I've looked at this but since it's excluding products rather than categories, it's close but no cigar

      I've tried editing it to exclude categories but may need to clear out my calendar!

    • Janusz Jasinski

      Been working on this and am close to giving up - it sure;y can't be *this* difficult?

      We are using it on the chat launch page where someone choose a category and they get redirected as needed - can someone else be built instead of this?

    • Janusz Jasinski

      So, this seems to work in manipulating the variable $this but all the categories still show *and also* after extending the widget *just* with the logic.js file, the design is all out of shape and looks entirely different to the original - why is this?

      var listToDelete = [741,613,635,620,614,71,730,630,619,618,621,631,628,629,634,732,632,624,727,627,633,625,626,];
      var a = this.data.js.link_map;
      for (var i = 0; i < this.data.js.link_map[0].length; i++) {
      var obj = this.data.js.link_map[0][i];
      if (listToDelete.indexOf(obj.id) !== -1) {
      this.data.js.link_map[0].splice(i, 1);
      i--;
      }
      }
    • Janusz Jasinski

      So I got it working by adding it to the buildPanel function

      However the design is still all messed up - isn't it meant to look the same?

    • R P

      Easier way to achieve this is using CBO and creating extended Prod Category model so you can filter & remove categories/products as needed basis.

    • Janusz Jasinski

      CBO?

      I've posted the solution in https://cloudcustomerconnect.oracle.com/posts/9e07039cb2 which just needed the logic.js file amending

    • R P

      Custom Business Objects, it allows you to control category visibility from console and in case if you have multiple test environments, IDs might be different for each so better to control via console but other solution you posted will work as well.

    • Janusz Jasinski

      Any examples? If I go to Products/Categories/Dispositions and hide a category there, if I have a form or some knowledge with that category, it won't work/show

      Doing it via a custom widget means you can choose what categories to display depending on what page you are on