jerett Posted July 12, 2013 Share Posted July 12, 2013 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! 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 12, 2013 Share Posted July 12, 2013 I'm not aware of an existing plugin to do this but this could be done using a ClientAreaPage hook to restrict access to the register and order form pages. 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 13, 2013 Author Share Posted July 13, 2013 I'm not aware of an existing plugin to do this but this could be done using a ClientAreaPage hook to restrict access to the register and order form pages. What do u mean 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 13, 2013 Share Posted July 13, 2013 A hook can be used to modify just about anything in WHMCS, you could make a ClientAreaHook to redirect to a page that asks for the promo code, if it is entered correctly, then take them to the order form. http://docs.whmcs.com/Hooks:System#ClientAreaPage http://docs.whmcs.com/Hooks 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 13, 2013 Author Share Posted July 13, 2013 Does it require some programming knowledge? Im guessing it does 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 13, 2013 Share Posted July 13, 2013 Yes, hooks are written in PHP 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 13, 2013 Author Share Posted July 13, 2013 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. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 13, 2013 Share Posted July 13, 2013 That is doable but it would take some programming to make the hook and the interfaces for giving invites. 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 13, 2013 Author Share Posted July 13, 2013 How much would something like this project generally cost someone? 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 14, 2013 Share Posted July 14, 2013 It would be in the $250-500 USD range to develop something like this. 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 14, 2013 Author Share Posted July 14, 2013 All right thanks. I will see what I can do for the time being and start planning for worse case scenario of getting this developed. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 14, 2013 Share Posted July 14, 2013 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. 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 14, 2013 Author Share Posted July 14, 2013 Is there a way to make a promotion code requires on the order form? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2013 Share Posted July 15, 2013 (edited) 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 July 15, 2013 by brian! 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 15, 2013 Author Share Posted July 15, 2013 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2013 Share Posted July 15, 2013 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! 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 15, 2013 Author Share Posted July 15, 2013 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. 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 15, 2013 Author Share Posted July 15, 2013 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 /> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2013 Share Posted July 15, 2013 (edited) 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 July 15, 2013 by brian! 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted July 15, 2013 Author Share Posted July 15, 2013 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2013 Share Posted July 15, 2013 that's good to hear - I didn't expect that just making the field required would be enough. i'm glad that I helped you find a solution... and saved you some money along the way! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.