Jump to content

Different Client area options / product dependant


theviewer1985

Recommended Posts

To help explain, i offer 2 products. Hosting and pay monthly web design with hosting included. Both are using cPanel as the server - they are just differently priced.

With hosting, i dont mind all the cpanel features being built into WHMCS client area service page. Where they can click cpanel shortcuts or log into cpanel directly. So the cPanel template default is fine.

However, with pay monthly websdeign i dont want them having access to cpanel. Is there a way to customise the product page to be product dependant so i can hide cpanel related stuff if they are a pay monthly customer? 

Or any other ways people can think of to help in this area?

I know clicking on the service page basically loads a "cpanel" template file from WHMCS. So not sure if i could have two of them, and somehow link the paymonthly product to that template file instead.

 

Cheers

Link to comment
Share on other sites

8 minutes ago, theviewer1985 said:

Is there a way to customise the product page to be product dependant so i can hide cpanel related stuff if they are a pay monthly customer? 

well they will be logged in when looking at the product details page, so you'll know who they are, and can find out what products they have.... and certainly with one line, you could get the PID value and that's going to quickly tell you whether this is a hosting or MWD product.

13 minutes ago, theviewer1985 said:

Or any other ways people can think of to help in this area?

i'm trying to think of the simplest solution without unnecessary work - though really you will probably need to work you way through the cpanel product details page and decide which parts to keep and what to remove.... I would assume Quick Shortcuts and Quick Email could be binned... one way being to use CSS in a hook to hide that content, or using a ClientAreaProductDetailsPreModuleTemplate hook to null a particular variable to prevent both panels being shown... and then you'd have to think about the sidebar links.

but as I said, how to do this really depends on what you need to do with the output and whether that could be achieved using hooks and/or CSS, or whether you need to start playing with the cpanel template directly.

Link to comment
Share on other sites

2 hours ago, brian! said:

well they will be logged in when looking at the product details page, so you'll know who they are, and can find out what products they have.... and certainly with one line, you could get the PID value and that's going to quickly tell you whether this is a hosting or MWD product.

i'm trying to think of the simplest solution without unnecessary work - though really you will probably need to work you way through the cpanel product details page and decide which parts to keep and what to remove.... I would assume Quick Shortcuts and Quick Email could be binned... one way being to use CSS in a hook to hide that content, or using a ClientAreaProductDetailsPreModuleTemplate hook to null a particular variable to prevent both panels being shown... and then you'd have to think about the sidebar links.

but as I said, how to do this really depends on what you need to do with the output and whether that could be achieved using hooks and/or CSS, or whether you need to start playing with the cpanel template directly.

You are half way understanding what i need. My poor description isnt helping.

Yes those cpanel shortcuts you speak of are binned already via a CSS hide style. But that hides it for everyone (not just my pay monthly customers). Thats essentially my main desire - to be able to hide the cpanel shortcuts panel for specific products only. So then my hosting products get full access... but my pay monthly products see less. Even though they are both cpanel products at the root.

Does that make more sense?

Link to comment
Share on other sites

18 hours ago, theviewer1985 said:

You are half way understanding what i need. My poor description isnt helping.

I always aim for at least a 50% understanding rating when answering a question - i'm doing well so far. 🙂

18 hours ago, theviewer1985 said:

Yes those cpanel shortcuts you speak of are binned already via a CSS hide style. But that hides it for everyone (not just my pay monthly customers).

you couldn't do it with CSS in a custom.css file - it's effect would be global.... hence why I mentioned CSS in a hook because then you can decide when and where it's applied.

18 hours ago, theviewer1985 said:

Thats essentially my main desire - to be able to hide the cpanel shortcuts panel for specific products only. So then my hosting products get full access... but my pay monthly products see less. Even though they are both cpanel products at the root.

I think that's in the 50% I understood. 😎

what I had in mind yesterday was a simple hook along these lines...

<?php

# Remove cPanel Shortcuts From Products Page Hook
# Written by brian!

function remove_cpanel_panels_from_products_page_hook($vars)
{
	$webdesignPIDs = array(2);
	if (in_array($vars['pid'],$webdesignPIDs)) {
		return array("systemStatus" => null);
	}
}
add_hook("ClientAreaProductDetailsPreModuleTemplate", 1, "remove_cpanel_panels_from_products_page_hook");

let's say for your two products, PID #1 is hosting, and PID#2 is webdesign - so $webdesignPIDs is an array containing a list of product IDS to be included in this webdesign category... for now, it's only #2.

when a user visits the product details page, the hook will run - if the current product ID matches a value within the $webdesignPIDs array, then effectively the two quick panels below won't be included in the output...

66vqzRO.png

... but if the current PID is not in the array, then the hook will do nothing and the user will be able to view the two panels above.

the idea works because the above output is conditional on the value of that variable the hook returns - if you needed to remove other items on that page for these users, at that point, you're likely going to need CSS in hooks (which would use a different hook point and another method).

Link to comment
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