Jump to content

Invite only system


jerett

Recommended Posts

Greetings,

 

I am trying to setup an invite only member area where unless you have a certain "code" you are not able to register or purchase a product/service.

 

Has anyone seen something similar to this being used with WHMCS or know of a work around by setting up WHMCS in a certain manner to mimic this action?

 

Thank you!

Link to comment
Share on other sites

And there lies my problem. I am pretty good manipulating things with the smarty tags - (sort of) but getting into the PHP a bit deeper goes beyond my design skills. I need to figure something out on how to get an environment like I mentioned. I know someone did a referral plugin that works by giving out domain rewards but I don't need that. :( I need something where I can give users a set amount of invites and they can invite friends from within the client area - and that is the only way you can signup for the particular service or order the product.

Link to comment
Share on other sites

I suppose a cheaper way to achieve a similar result would be to add high setup fees to your products, and then issue "free setup" promotional codes... ideally one-use only codes so they couldn't be shared and used multiple times...hopefully, the high setup fees should discourage anyone from purchasing without using a free setup promo code.

 

you could either create the promo codes yourself and then share with your clients, or you can add promo codes to links and share the links...

 

it's not an elegant or ideal solution, but I thought it worth suggesting as an alternative.

Link to comment
Share on other sites

yes - either by using smarty code (http://docs.whmcs.com/Template_Syntax) in the template or javascript...

 

the problem for you is that not only do you have to check the field isn't empty, you would also need to ensure a valid code was entered.

 

another alternative might be to add a custom field to the product(s) via Products -> Choose Product -> Custom Fields....

 

http://docs.whmcs.com/Custom_Fields#Product_Custom_Fields

 

you could make that a required field and on the order form - it would appear on the next page after the user chooses the product... what you would need to do then is figure out the regex to validate the input...

 

now regex is not my strongpoint, but you could use the expression below to check for specific words (or number codes)...

 

/^(\jerett|\brian|1534646)$/

with the above validation in place, the order couldn't progress until a valid code is entered...

 

of course these codes aren't unique and can be used multiple times, so you may have to create many and then remove them manually as they are used... or find some automated way to do it.

 

and then repeat the procedure on the other products.

Edited by brian!
Link to comment
Share on other sites

that's the problem - i need to make them required and to pick up on the current promotions set in the system. not sure how hard it would be to do this.

the promotions route may not be necessary if you use custom field idea... in fact, you could use both - the custom field to gain access to ordering, and then the option of using promo codes to discount certain products..

 

no doubt there's some sort of hook that will check whether a promotion code is valid, but that's beyond my knowledge of WHMCS! :)

Link to comment
Share on other sites

the promotions route may not be necessary if you use custom field idea... in fact, you could use both - the custom field to gain access to ordering, and then the option of using promo codes to discount certain products..

 

no doubt there's some sort of hook that will check whether a promotion code is valid, but that's beyond my knowledge of WHMCS! :)

 

the question is how would i make that custom field to be a unique invite code? there lies my problem.

Link to comment
Share on other sites

figured out how to make the promotion field required - you just add "required" the <input> call.

<input type="text" name="promocode" size="20" value="" required />

that wouldn't particularly help - it would just mean that something/anything needs to be typed in there, so even if it were an invalid promotion code, the order would still progress.

 

one thing that occurred to me last night is that the product custom field idea wouldn't work - it would be fine for buying hosting (and other products etc), but I don't think it would apply to domains... so the better way would be to add a custom client field - same principle, but only new customers would see it, existing customers would just login and wouldn't need to enter the code.

 

the question is how would i make that custom field to be a unique invite code? there lies my problem.

well I guess the solution would be to have a link in the client area that a customer can click on, that generates a unique code, writes it to a database table (client & code), and then when someone uses the code when ordering, it is checked against the database - if valid, it is used and removed; if not, order is rejected.

 

but if you're going to that much trouble, you might as well pay to get a custom hook solution coded for you!

 

my thought would be that if you think this invite code system is going to be used a lot by your customers, and hence it will generate income - then pay someone to code an automated solution to this problem... if you don't know how often it will be used, or you only have a handful of customers who might use it, then just add plenty of valid codes into the regex (as shown earlier) and remove them manually as they are used... and perhaps disable automatic setup for new customers so you can manually check codes first.

Edited by brian!
Link to comment
Share on other sites

Actually so far it seems to work just fine. I have a few codes setup in admin area and by making that field required it checks 1st to make sure the field isn't left blank - then the promotion functionality works after that. If you enter a wrong code - the cart won't process and you have to start over. As long as that field is required - it works like a charm - forcing the user to enter the right promo code in order to process.

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