MV How can I hide some specific categories while selling at shop?

So I am using "yepitemcategories.js" and have 6 categories for items which are " Weapons, armors, items, key items, books , collectibles" . When I go to shop to sell items under " items" category, all the other category show up.
Is there any way to HIDE the " key items " category along with custom created category ( i.e books , collectibles ) while SELLING ?

Thanks in advance
Just as a quick bit of advice, it is generally considered to be disruptive to make post subjects in all capital letters, which you've done a few times today - when typing to people, that's considered to convey shouting. The most formally correct way is to use capitalized words headline-style, or anything more casual than that. Also, you posted the same question multiple times in different forums, which is never necessary.

As far as your question, everything is possible, and this has even been done before!

I Googled "RPG Maker MV shop hide key items" and I found this thread, which has a plugin posted halfway down to do what you're asking.
Just as a quick bit of advice, it is generally considered to be disruptive to make post subjects in all capital letters, which you've done a few times today - when typing to people, that's considered to convey shouting. The most formally correct way is to use capitalized words headline-style, or anything more casual than that. Also, you posted the same question multiple times in different forums, which is never necessary.

As far as your question, everything is possible, and this has even been done before!

I Googled "RPG Maker MV shop hide key items" and I found this thread, which has a plugin posted halfway down to do what you're asking.
Sorry , I didn't know all those rules. Changed them now as you suggested so thanks for that.

Now moving to context I already have seen that plugin but it doesn't solve my issue. It only shows the "items" while selling. What I want to do is something like this : I have 6 categories of inventory ( 4 are the default ones and 2 custom ) . When selling , I want to hide the 2 custom category and 1 default category . How do I do this?


For reference, I found this but it's for VXA and I don't know how to port it to MV,

Moved to: Plugin Support
You can try to approach a coding solution that is not really elegant, but still. I'm not sure the way you're adding custom categories to the game, but you can try to do this:


Code:
(function() {
    var _old_item_category_makeCommandList = Window_ItemCategory.prototype.makeCommandList;
    Window_ItemCategory.prototype.makeCommandList = function() {   
        _old_item_category_makeCommandList.call(this);
        var scene = SceneManager._scene; // Storing current scene;
        if(!(scene instanceof Scene_Shop)) {return;} // If not scene shop, we'll not process the code
        if(scene._commandWindow.currentSymbol() !== "sell") {return;} // If we're not selling, we'll not process the code. Adding this line considering the chance that you added a plugins for supporting categories on buyWindow, too.
        this._list = this._list.filter(function(command) {
            return ![/*Add here the symbol of the categories you want to hide*/].contains(command.symbol)
            // Example: return !["keyItem", "myCustomCategory"].contains(command.symbol)
        }.bind(this))
    };

    var _old_scene_shop_commandSell = Scene_Shop.prototype.commandSell;
    Scene_Shop.prototype.commandSell = function() {
        this._categoryWindow.refresh(); // Refreshing the category window on command sell;
        return _old_scene_shop_commandSell.call(this)
    }

    var _old_scene_shop_commandBuy = Scene_Shop.prototype.commandBuy;
    Scene_Shop.prototype.commandBuy = function() {
        this._categoryWindow.refresh(); // Refreshing command window on command buy
        return _old_scene_shop_commandBuy.call(this)
    }

})()

In general, it's not necessary to proceed this way for the Scene_Shop, as in vanilla MV, category window works only for the Sell Window. However, acting this way, we should prevent the situation of another plugin that adds categories to buy window, too.

Add the script above in a JS file and it to your plugin manager. Remember to edit the array of above with the symbol of the categories you want to hide.
You can try to approach a coding solution that is not really elegant, but still. I'm not sure the way you're adding custom categories to the game, but you can try to do this:


Code:
(function() {
    var _old_item_category_makeCommandList = Window_ItemCategory.prototype.makeCommandList;
    Window_ItemCategory.prototype.makeCommandList = function() {  
        _old_item_category_makeCommandList.call(this);
        var scene = SceneManager._scene; // Storing current scene;
        if(!(scene instanceof Scene_Shop)) {return;} // If not scene shop, we'll not process the code
        if(scene._commandWindow.currentSymbol() !== "sell") {return;} // If we're not selling, we'll not process the code. Adding this line considering the chance that you added a plugins for supporting categories on buyWindow, too.
        this._list = this._list.filter(function(command) {
            return ![/*Add here the symbol of the categories you want to hide*/].contains(command.symbol)
            // Example: return !["keyItem", "myCustomCategory"].contains(command.symbol)
        }.bind(this))
    };

    var _old_scene_shop_commandSell = Scene_Shop.prototype.commandSell;
    Scene_Shop.prototype.commandSell = function() {
        this._categoryWindow.refresh(); // Refreshing the category window on command sell;
        return _old_scene_shop_commandSell.call(this)
    }

    var _old_scene_shop_commandBuy = Scene_Shop.prototype.commandBuy;
    Scene_Shop.prototype.commandBuy = function() {
        this._categoryWindow.refresh(); // Refreshing command window on command buy
        return _old_scene_shop_commandBuy.call(this)
    }

})()

In general, it's not necessary to proceed this way for the Scene_Shop, as in vanilla MV, category window works only for the Sell Window. However, acting this way, we should prevent the situation of another plugin that adds categories to buy window, too.

Add the script above in a JS file and it to your plugin manager. Remember to edit the array of above with the symbol of the categories you want to hide.
Sorry for late reply. Thank you for your time. It somehow worked. It hides the key items but not the custom categories.

I create custom categories using yanfly yep_x_itemcategories.js . It works like this,

TO create custom category, inside the plugin you need to add " Category: Custom Name" ( Ex: "Category: Food".) .

I have three categories " Category: Books" , "Category: Gameplay Mechanics" , "Category: Construction Materials".

I used your code and added " Category" as the custom-name but it hid all the three custom categories. I just want to hide the "Category: Books" and " Category: Gameplay Mechanics" from showing in sell shop?

------------------------------------------------------------------------------------------------------------------
I attached the yanfly category plugin, if you would want to take a look.

Again, thank you for your time and effort.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-hide-some-specific-categories-while-selling-at-shop.138777/