Jump to content
Mojocreative

Custom categories.json file not working

Recommended Posts

Hi

I created a categories.json file as outlined in this page: https://docs.whmcs.com/Domain_Categories

I followed the instructions, created the new categories.json file.  Modified the file and saved it - see file-manager.png

When I go to my domain page, the existing categories are still there and my new ones are not showing up at all. 

Also they mention in the article that The domain categories shipped with WHMCS by default can be found in /resources/domains/dist.categories.json. This file should not be edited.  This file does not exist in this folder (see image file-manager).

What I ideally want is not to show their default categories at all but to only show my categories.

I have also attache my categories.json file for review too.

 

 

 

 

file-manager.png

categories.json

Share this post


Link to post
Share on other sites
23 hours ago, Mojocreative said:

I followed the instructions, created the new categories.json file.  Modified the file and saved it - see file-manager.png

When I go to my domain page, the existing categories are still there and my new ones are not showing up at all. 

it didn't help that categories.json wasn't configured correctly...

{
"New Zealand Domains": [".co.nz",".nz",".net.nz",".org.nz",".ac.nz",".gen.nz",".geek.nz",".maori.nz",".school.nz",".kiwi.nz",".kiwi"],
"Australian Domains": [".com.au",".net.au",".org.au"],
"International Domains": [".com",".net",".org",".co",".info",".biz",".us",".co.za",".uk",".co.uk","eu",".fr",".it",".de"],
"Asia Domains": [".asia",".sg",".cn",".jp",".in",".ph",".my",".hk",".id"]
}

oBpyydZ.png

23 hours ago, Mojocreative said:

Also they mention in the article that The domain categories shipped with WHMCS by default can be found in /resources/domains/dist.categories.json. This file should not be edited.  This file does not exist in this folder (see image file-manager).

as the docs page says, that file only exists in v7.10 or later - going by those creation dates in the screenshot, it looks like it's a v7.9.2 or earlier version - and therefore the above documentation wouldn't apply.

if it's pre v7.10, then the categories will be defined in the database and not in the json files.

23 hours ago, Mojocreative said:

What I ideally want is not to show their default categories at all but to only show my categories.

even for a new feature, it's extraordinarily flaky and badly documented - i'm sure that I did that once, but could never repeat it.. nor remember exactly how... though I suspect it involved playing with the encoding of the file.

if you really had to, there are ways to do it with v7.10+ (see below image), but if you're using an earlier version, that method wouldn't be available to you - so you'd be left with editing the database, hooking or modifying the template.

U1tJPEQ.png

Share this post


Link to post
Share on other sites

Thank you for you help - I updated my categories.json as above and it is now working .  I have also upgraded to the latest version v7.10.

It is now displaying correctly.  I still have Popular and Geographic Categories popping up, will see how I can hide them

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated