Creating new relationships with the Product Categories module - has anyone done this?


We have a requirement to create a relationship between the Product Categories module and a 'module-builder module'.

Unfortunately, this module is not visible in Studio.

Do you think the best approach would be to try and enable this to be visible in Studio and try to create a relationship from there?
Or just try to create a custom code relationship?

Thanks! James.

  • Whenever we need to either create a relationship or custom field into the Product Categories module we create them by hand.

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hi James,

    If I understand your question correctly, you want to create a relationship between the Product Categories module and custom module in Sugar.

    As few modules like Manufacturers, Product Categories, etc are hidden in studio by default we don't see them in the Studio to do any modifications like adding new custom fields or custom relationships. I suggest you to bring this module to studio through a simple method instead of creating relationship through code.

    If you add an empty studio.php (with just php tags open and close) file in below path you can see the Product Categories module in Studio and then you can add relationship easily.


    Once the file is in place give repair and rebuild and now you can see the Product Categories module in studio.

    Please do this first on your development instance and test it.

    Hope this information helps you:)

    Thanks and Regards,


  • hi Andre'

    Do you have a specific reason to use that approach instead of the suggestion from ?

    Genuinly interested in pro and cons for each approach, as I have a similar post regarding Product Catalogue and Tax Rates..

    Thanks in advance

  • 's approach works as well. Enabling "hidden" modules on Studio is not a big deal and it has not potential side effects.

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hi PK, 

    Thanks for the tip! Very useful.
    We did actually create this file last week and was then able to see this module in Studio.
    We were also able to create the relationship in Studio between the custom (module builder) module and Categories. 

    The only trouble was that it didn't produce a sub-panel on the Categories side (1-many) so we think we're going to also implement this via code.

    Thanks for your inputs.