Allow custom Templates based on "six" to be used

Hi,

after the migration to WHMCS v6 with your latest plugin version (thanks alot that this is working out so smoothley finally!) we figured out some edges of the plugin that can be easily improved to make it even more flexible.

Usecase: We have a custom template in WHMCS used for the clientarea as well as the orderforms. With the new WHMCS version this templates are both based on the new bootstrap templates.

Problem: Your plugin only allows "six" or "portal" in the dropdown and at several positions in the code. But any derivation of "six" will also work fine.

I did some manual fixes to your plugin to make it work, but would suggest you simply pimp the plugin itself, so everyone can enjoy it :slight_smile:

In WP-Admin config screen:
1. Add another option to the dropdown called "Own template based on six"
2. If that is selected, show an input field that will then be used for "$this->template" in the code

In the integration code:
1. Where you have "six" hardcoded (there was a line I believe with the parser for the js or css) use $this->template instead
2. If the selected template is a "six" derivate, use "whmcs-six.css" instead of "whmcs-".$this->template.". That is the css fix you deliver with the plugin.

Should be done in about 30 minutes and make it also fully compatible with custom themes based on "six".

Thx and brgds,

Jan

  • Sajid

    Hi @Jan

    Hope you are doing good today :slight_smile:

    Thank you very much for all the suggestions and feedback to make the WHMCS plugin compatible with custom template.

    I am flagging the developer here for their invaluable feedback on this matter an passinig along your suggestion to them so it can be integrated in future of version of this plugin (if possible).

    They will respond here as soon as possible.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Jose

    Hello there Jan,

    Hope you are doing great.
    I must admit that we consider this alternative while developing the support for six template. The reason why we didn't add it to the core is simply because we can't guarantee that every extension of six template will work out of the box.
    If the changes are just on CSS front, it will likely work without issues.
    But if the customization alter the HTML markup or adds some custom javascript, then there are chances to break the parser. As you may already noticed, it relies in very specific contents in the markup in order to work correctly.

    So, at this point, it is a matter of business decision. If we have an option "Own template based on six" we may have a lot of 'bug' reports.

    I'll take note of this suggestion to discuss with the team and try to find an alternative. I agree with you that this can be useful for many users.

    It worth nothing to mention that, if the customization is only on CSS side, you can use the following define to avoid loading the CSS styles from WHMCS:
    define('WHMCS_LOAD_STYLES', false);
    Then, you can enqueue your customized CSS directly using wp_enqueue_style( ); in your theme's functions.php.

    Thanks for you suggestions to improve the plugin :slight_smile:

    Cheers,
    José

  • Jan

    Hi Jose,

    thanks for your explainations. Did a long thought about your reply and finally came up with a solution. The customizations are mainly changed templates to add or remove some functionality for our customers. In fact you have to create a custom Template in WHMCS if you do not want to lose your custom invoice layout after each update...

    So it sadly isn't just CSS. But thanks for that hint anyway.

    I definately understand your approach and wouldn't chose otherwise if I were you.
    If you still stick to minimize false positive support cases, there should be one possible way to go:

    Do not add this option to the UI, but allow it via wp-config.php parameter and do not tell too many people about this possibility :wink:. Or explicitly stating this is "On own risk". Like
    define("WPMUDEV_WHMCS_CUSTOM_v6_TEMPLATE","name_of_custom_v6_template");
    In this case those who (should) know what they are doing can add custom templates on their own risk and without support on your side.

    That should make everything possible I described in my first post with keeping the issues of too many support questions arising. Further more updating your plugin is safe again for advances users like me.

    So it might be kind of a solution for everyone :slight_smile:.

    Thanks again for considering and the great work Jose!

    Jan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.