Jump to content

1st Month Discounted without using PROMO Codes


Recommended Posts

Hello, community.

 

Using the latest WHMCS version. I'm looking at offering a discounted price on ALL plans for ONLY the first month. Say for example 50% of the first-month price OR a fixed amount for the first month lets say $1 which would apply to ALL plans and only for the first month.

I don't want to use promo codes to achieve this as it will mean creating loads of promos codes for the many different plans. I have looked at posts and docs but cannot seem to find an answer.

I would have thought this is something basic that would be included in WHMCS. I do remember doing this for a much older version of WHMCS, perhaps that functionality has been removed OR I am obviously missing a setting somewhere?

 

Can anyone shed any light on this?

Link to comment
Share on other sites

53 minutes ago, Manchester Web Hosting said:

Using the latest WHMCS version. I'm looking at offering a discounted price on ALL plans for ONLY the first month. Say for example 50% of the first-month price OR a fixed amount for the first month lets say $1 which would apply to ALL plans and only for the first month.

I don't want to use promo codes to achieve this as it will mean creating loads of promos codes for the many different plans. I have looked at posts and docs but cannot seem to find an answer.

why do you think you need to create multiple promo codes?? from your description and assuming they're monthly cycle products only, you just need 2 - one that would give a $1 discount, and another to give 50%... promo codes can apply to multiple products, so you don't necessarily need one promo code per product... they should be non-recurring; monthly cycle only;apply once; apply once/client etc.

if you were wanting to add a discounted 1st month on an annual product, then that would likely require separate promo codes for each product, but I assume you're not wanting to do that?

the alternative might be to try ModulesGarden's Discount Center addon - they're offering a 33% one-time discount code themselves at the moment...

53 minutes ago, Manchester Web Hosting said:

I would have thought this is something basic that would be included in WHMCS. I do remember doing this for a much older version of WHMCS, perhaps that functionality has been removed OR I am obviously missing a setting somewhere?

other than promo codes, or a discount addon module, I can't think of any simple alternative... but you've used WHMCS longer than I, so perhaps it was pre v5 ??

Link to comment
Share on other sites

Hello @brian! thanks for the very quick response.

Hmm. Yup, it is for monthly cycles.

I was hoping not to change the URL's linking to the WHMCS cart. As I would need to append the promo code to say 50+ cart URL's that already exist.

Another problem that may occur is that say I want to use the fixed promo code, each of my products has a different price. So one product may cost $5 another $7 another $8 etc so the 1 fixed promo code discount wouldn't work? hence why I stated I didn't want to use multiple promo codes. I also think this same issue would be the case for percentage based discounts. I hope I'm explaining that right.

What I am trying to achieve is to have $1 package price for the first month (for example) regardless of what the actual package prices are only for the first month then it goes back to normal on the 2nd month. If the packages were all priced the same then promo codes would probably be the ideal way (albeit having to change the 50+ links!)

I have seen the modules garden plugin. Hesitant to go for an actual plugin as with all the changes that WHMCS makes some plugins eventually don't work! I have had that issue over the years with many plugins and themes too, that when a WHMCS update lands the plugin/themes don't work as intended anymore. The plugin authors cannot be ar**d to update them, granted modules garden is probably not in that category but you never know.

Much prefer to use a hook or change a bit of code myself at least that way I know its kind of future proof.

Yup, been a user since way back 2008! the product is getting better in some areas BUT worse OR not even addressing the bugs in other areas. When Matt was around things ran smoothly (somewhat). Its always the case the bigger you get the less important your customers become, coupled with the fact that over 90% of the code is obfuscated makes it a pain to fix things yourself. IF there was an alternative product that had all the functionality + more than I would seriously consider moving.

Link to comment
Share on other sites

Hi,

38 minutes ago, Manchester Web Hosting said:

thanks for the very quick response

Saturday afternoon usually equals watching live soccer stream, doing paper admin at the same time... and where possible, no coding!

38 minutes ago, Manchester Web Hosting said:

Yup, it is for monthly cycles.

cool - that gets rid of the main complication of multiple cycles.

38 minutes ago, Manchester Web Hosting said:

I was hoping not to change the URL's linking to the WHMCS cart. As I would need to append the promo code to say 50+ cart URL's that already exist.

URLs in the template code or external links ?

38 minutes ago, Manchester Web Hosting said:

Another problem that may occur is that say I want to use the fixed promo code, each of my products has a different price. So one product may cost $5 another $7 another $8 etc so the 1 fixed promo code discount wouldn't work? hence why I stated I didn't want to use multiple promo codes. I also think this same issue would be the case for percentage based discounts. I hope I'm explaining that right.

I think it would work fine - certainly in terms of percentages... let's say we have two products, $10 pm and $30pm, and you want to apply a 50% discount code to each, that takes them to $5 and $15pm respectively... so one promo code has adjusted different prices by the same percentage... unless i'm failing to grasp what you're trying to do, that sounds like a valid solution to me.

38 minutes ago, Manchester Web Hosting said:

What I am trying to achieve is to have $1 package price for the first month (for example) regardless of what the actual package prices are only for the first month then it goes back to normal on the 2nd month. If the packages were all priced the same then promo codes would probably be the ideal way (albeit having to change the 50+ links!)

aaahhh... this is even easier - you just use the Price Override promo code option... thanks.png

NXvCmPc.png

so this is a £200 monthly product, discounted for the 1st month to £1.. and after that they'll pay £200 per month.

NV0R1hZ.png

38 minutes ago, Manchester Web Hosting said:

I have seen the modules garden plugin. Hesitant to go for an actual plugin as with all the changes that WHMCS makes some plugins eventually don't work! I have had that issue over the years with many plugins and themes too, that when a WHMCS update lands the plugin/themes don't work as intended anymore. The plugin authors cannot be ar**d to update them, granted modules garden is probably not in that category but you never know.

I wouldn't rule out any developer falling into that category.. i've seen too many come and go from here over the years..

38 minutes ago, Manchester Web Hosting said:

Much prefer to use a hook or change a bit of code myself at least that way I know its kind of future proof.

I did toy with suggesting a OrderProductPricingOverride hook, but that changes the recurring amount (applied today and in the future) which is not really what you want to do... I suspect your best bet is promo codes.

38 minutes ago, Manchester Web Hosting said:

Yup, been a user since way back 2008! the product is getting better in some areas BUT worse OR not even addressing the bugs in other areas. When Matt was around things ran smoothly (somewhat).

yes I can remember when I first joined how fondly users spoke about when Matt had more of a hands-on role... that was slightly before my time I think though.

38 minutes ago, Manchester Web Hosting said:

Its always the case the bigger you get the less important your customers become, coupled with the fact that over 90% of the code is obfuscated makes it a pain to fix things yourself.

tell me about it - especially when the remaining 10% is badly (or not even) documented... I suspect the vast majority of what I know is from experience/exploration rather than what's in the actual documentation (which may not be accurate or even up-to-date).

38 minutes ago, Manchester Web Hosting said:

IF there was an alternative product that had all the functionality + more than I would seriously consider moving.

sadly, you aren't the first person to tell me that. headshake.gif

Link to comment
Share on other sites

Hello,

Quote

Saturday afternoon usually equals watching live soccer stream and doing paper admin at the same time...

LOL surprised you even get time to either of those seeing you are the unofficial support guy for WHMCS and community! Been following you for quite some time and your help and support should be the standard that WHMCS takes... Yea right that will be the day! They should be you a hefty commision for the work you do 🙂

5 minutes ago, brian! said:

cool - that gets rid of the main complication of multiple cycles.

Yup, it's just for the first month and then subsequent cycles can stay as is.

6 minutes ago, brian! said:

URLs in the template code or external links ?

Nope, I have kept the whmcs theme totally separate and have a bespoke frontend which I use a cms for. The links are then placed where I need them to be. Thus the 50+ links id need to change.

7 minutes ago, brian! said:

I think it would work fine - certainly in terms of percentages... let's say we have two products, $10 pm and $30pm, and you want to apply a 50% discount code to each, that takes them to $5 and $15pm respectively... so one promo code has adjusted different prices by the same percentage... unless i'm failing to grasp what you're trying to do, that sounds like a valid solution to me.

Yea that would work for percentages IF I wanted discounts based on percentage. However, don't think that's the right solution for what I am looking to do. More on that below.

8 minutes ago, brian! said:

aaahhh... this is even easier - you just use the Price Override promo code option... thanks.png

Whoopee, this looks like what I am after. So in effect, I just create the one promo code as you have shown then append that promo code to the cart URL in my frontend pages (or wherever I have manually added the links) and that will apply the promo code i require?

I am also taking it that IF you went straight to the shopping cart then the promo rule(s) wouldn't work as they are not appended to the URL? OR am I getting this part wrong? Is it a case of creating that pricing override promo code and then apply it to products? don't think that's the case as that would be simply too easy and that would be a new one for WHMCS!

13 minutes ago, brian! said:

I wouldn't rule out any developer falling into that category.. i've seen too many come and go from here over the years..

Yea, seen loads come and go. I have been a bit of a back seat passenger most of the time as what works now doesn't work on a new version.

14 minutes ago, brian! said:

I did toy with suggesting a OrderProductPricingOverride hook, but that changes the recurring amount (applied today and in the future) which is not really what you want to do... I suspect your best bet is promo codes.

yes, that's a bit of an overkill BUT may have been suitable IF the pricing overrides weren't available.

15 minutes ago, brian! said:

yes I can remember when I first joined how fondly users spoke about when Matt had more of a hands-on role... that was slightly before my time I think though.

it was much better in terms of support then. He was very active. Since becoming big you never hear from him.

16 minutes ago, brian! said:

tell me about it - especially when the remaining 10% is badly (or not even) documented... I suspect the vast majority of what I know is from experience/exploration rather than what's in the actual documentation (which may not be accurate or even up-to-date).

you got that right. the docs are all over the place. Even when you do find something it doesn't make sense and the examples. Well, you need to be a rocket scientist to figure it out at times. I'm a magento developer by nature but their stuff mostly goes over my head. I think mainly because of the docs are super confusing. Don't think they know whats going on. Let's not forget what a farce the feedback community is (user requests) what a joke.

18 minutes ago, brian! said:

sadly, you aren't the first person to tell me that. headshake.gif

we should all get together and develop one. Matt did this as he says an opening in the market and that other users were getting fed up with what was avliable way back when. Hence WHMCS came about. Silly to think thatsthe foots on the other shoe now.

 

lastly, Thankyou you have been super helpful as usual @brian!

Link to comment
Share on other sites

I'm having a play around with pricing overrides promo now.

It works when I use the promo code in checkout section etc BUT as I suspected I would have to apply it via the 'apply promo code' box.

Not ideal as I can see some potential customers missing that and getting put off when they see the full price!

Adding the promo to the URL within external links should also work fine. Just got to find an ideal way for it to work if someone lands into the cart/order area directly.

Is there a conditional call? that could be used in the cart template to say:

IF this promo code exists then display some HTML (which would show potential customers a message) ??

OR more ideally IF that promo code exists and is valid to auto apply it to the product?? auto applying the promo would be the best way I think.

Also downloaded the discount centre via modules garden. Going to see how that works too BUT as you already know not a fan of plugins for reasons outlined previously!

If you could let me know about some of the things that I have posted above that would be great.

In the meantime, I'll have a play around for now and post an update once I have done some tests.

Link to comment
Share on other sites

Hi,

17 hours ago, Manchester Web Hosting said:

LOL surprised you even get time to either of those seeing you are the unofficial support guy for WHMCS and community!

if I don't do it, you'd likely be left in the hands of the official support - nobody deserves that outcome. 😛

17 hours ago, Manchester Web Hosting said:

Been following you for quite some time and your help and support should be the standard that WHMCS takes...

that's very kind of you to say... though I had a feeling walking down the street earlier today, there was someone following me. 🕵️‍♂️

17 hours ago, Manchester Web Hosting said:

Nope, I have kept the whmcs theme totally separate and have a bespoke frontend which I use a cms for. The links are then placed where I need them to be. Thus the 50+ links id need to change.

ok - there are possible options to get around that.

17 hours ago, Manchester Web Hosting said:

Whoopee, this looks like what I am after. So in effect, I just create the one promo code as you have shown then append that promo code to the cart URL in my frontend pages (or wherever I have manually added the links) and that will apply the promo code i require?

yes - it will pass the promocode to the cart, and then the cart will determine if there are applicable products and apply the discount accordingly... they should be in the format...

http://www.domain.com/cart.php?a=add&pid=xxx&promocode=manchester

however, the promotional discount won't be shown/confirmed until you get to viewcart... that's one of the quirks of WHMCS. 🙄

17 hours ago, Manchester Web Hosting said:

I am also taking it that IF you went straight to the shopping cart then the promo rule(s) wouldn't work as they are not appended to the URL? OR am I getting this part wrong?

no you are correct - the promocode can be passed in the URL or by the client entering it during the cart process... if they do neither, then they're paying full-price!

17 hours ago, Manchester Web Hosting said:

Is it a case of creating that pricing override promo code and then apply it to products? don't think that's the case as that would be simply too easy and that would be a new one for WHMCS!

that's all there is to it - it must be old WHMCS functionality, because if it was a recently introduced feature, it would only work when there is an R in the month. 😛

17 hours ago, Manchester Web Hosting said:

we should all get together and develop one.

well let me know if it gets off the ground and i'll run the Support department for you. 😀

16 hours ago, Manchester Web Hosting said:

It works when I use the promo code in checkout section etc BUT as I suspected I would have to apply it via the 'apply promo code' box.

Not ideal as I can see some potential customers missing that and getting put off when they see the full price!

it works passing it in the URL, but as I said earlier, the discount isn't shown until the end... that's difficult to work around.. it's one of those horrible bug (sorry design flaws) that never gets fixed.

16 hours ago, Manchester Web Hosting said:

Adding the promo to the URL within external links should also work fine. Just got to find an ideal way for it to work if someone lands into the cart/order area directly.

if you also want it to work when a client doesn't use a promo URL or doesn't enter the promocode themselves (e.g for everyone), then you can hardcode the promocode into the template... specifically, configureproduct.tpl and change..

<form id="frmConfigureProduct">
	<input type="hidden" name="configure" value="true" />
	<input type="hidden" name="i" value="{$i}" />

to...

<form id="frmConfigureProduct">
	<input type="hidden" name="configure" value="true" />
	<input type="hidden" name="i" value="{$i}" />
	<input type="hidden" name="promocode" value="manchester" />

where "manchester" is the promocode you want to pass... effectively, just by hitting the "Continue" button in the order summary box, the client will be passing the promocode themselves... they just won't know it.

if you go down this road, and it works in your custom template, then you shouldn't need to change the 50+ links (assuming they use the configureproduct.tpl stage during ordering).

9dUzhk1.png

however, this will pass the promocode for all products/domains etc, even ones that might be inapplicable to the promo, e.g domain registrations.. and this will show an alert at viewcart...

e3rXk1C.png

the quick fix to suppress this alert would be to edit viewcart.tpl and remove (or comment out)...

{elseif $promotioncode && $rawdiscount eq "0.00"}
	<div class="alert alert-info text-center" role="alert">
		{$LANG.promoappliedbutnodiscount}
	</div>
16 hours ago, Manchester Web Hosting said:

IF this promo code exists then display some HTML (which would show potential customers a message) ??

OR more ideally IF that promo code exists and is valid to auto apply it to the product?? auto applying the promo would be the best way I think.

see above! 😀

16 hours ago, Manchester Web Hosting said:

If you could let me know about some of the things that I have posted above that would be great.

hopefully i've pointed you in the right direction - above code is taken from standard_cart, but probably won't be a million miles away from your custom templates.

Link to comment
Share on other sites

Hello @brian!

18 hours ago, brian! said:

that's very kind of you to say... though I had a feeling walking down the street earlier today, there was someone following me. 🕵️‍♂️

Credit where credit is due my friend! Errmm maybe was me IF you're in Liverpool?! LOL

Just a quick update. So I have been playing around with the promo code price override and seems to be doing the trick.

Pain in the butt the order templates everything is all over the place. Have tweaked it somewhat and used the:

18 hours ago, brian! said:

<form id="frmConfigureProduct">

way so that I don't have to fiddle about with my external links. Also, some customers may land directly on the cart so its the better option for now. Yup will get the error message for products that are not in promo selection BUT I can live with that for now!

This also helped me out:

again that's your handy work 😀 as the {$promotiondescription} doesn't exist in the language files. It's Sunday so won't  🤬

All of it is now working as expected. The last thing I am now trying to do is get a message up on the products.tlp file to show that a promo exits for the group selection. I have tried:

{if $gid == '1'}<p>Custom Message</p>{/if}

 BUT then when I add in my other gid's like:
 

{if $gid == '1' or '2'}<p>Custom Message</p>{/if}

{if $gid == '1&2'}<p>Custom Message</p>{/if}

it doesn't work as expected. Also tried the following if statements in various combinations which don't have the desired output:

if ($servertype == 'cpanel')
{if $pid eq '1'}
if ($product == '1')

I want the custom message to show on the group id's I select.

I also think that this may be better in a hook? as that way, I won't need to manually update the template file which then won't need updating when a new WHMCS version comes out.

What are your thoughts? and can you help on this last bit, please? Thanks...

 

Link to comment
Share on other sites

59 minutes ago, Manchester Web Hosting said:

as the {$promotiondescription} doesn't exist in the language files.

it won't - it's a Smarty variable generated by WHMCS determined by the promo type, e.g "£1.00GBP Price Override One Time Discount"...

so if we were to update that code for Standard_cart, it would be...

{if $promotioncode}
	<div class="clearfix">
		<span class="pull-left">{if $LANG.promocode.{$promotioncode}}{$LANG.promocode.{$promotioncode}}{else}{$promotiondescription}{/if}</span>
		<span id="discount" class="pull-right">{$discount}</span>
	</div>
{/if}
$_LANG['promocode']['manchester'] = "Brian's £1 Special Offer!";

Tcng1e3.png

i've tweaked it to work for multiple promo codes - so if a promocode is added, and it has a language override, that override gets displayed - otherwise it just displays $promotiondescription... it;s only a rough suggestion that you might not need, but it's expandable to whatever you want it to display.

1 hour ago, Manchester Web Hosting said:

The last thing I am now trying to do is get a message up on the products.tlp file to show that a promo exits for the group selection.

for promocodes, the database only stores which products are applicable to it - it wouldn't be difficult to write a hook to query if the current group has a product that is mentioned in a promocode, but I don't think it's necessary.

{if $gid eq '1'}Custom Message{/if}

the above would work.. as would the code below...

{if $gid eq '1' or $gid eq '2'}Custom Message{/if}
{if (in_array($gid, [1,2]))}Custom Message{/if}
1 hour ago, Manchester Web Hosting said:

Also tried the following if statements in various combinations which don't have the desired output

$servertype and $pid don't exist... if you were inside the $products loop, you could use $product.pid to identify a specific product.

2 hours ago, Manchester Web Hosting said:

I want the custom message to show on the group id's I select.

there is a coding-free method to do this (if you're orderform template supports it), you could use either the "Headline" or "Tagline" options within the product group name settings from setup -> products/services -> products/services... edit product group

https://docs.whmcs.com/Product_Groups#Headline.2FTagline

4ybPkgF.png

which in the cart, looks like this..

TTV8Nrx.png

2 hours ago, Manchester Web Hosting said:

I also think that this may be better in a hook? as that way, I won't need to manually update the template file which then won't need updating when a new WHMCS version comes out.

What are your thoughts? and can you help on this last bit, please? Thanks...

if you could use Headlines and/or Taglines, then those values would be stored in the database, and if you were using Dynamic Field Translations, they could be shown in other languages too.

Link to comment
Share on other sites

Bummer. As usual, life is made difficult by you know who!

20 hours ago, brian! said:

i've tweaked it to work for multiple promo codes - so if a promocode is added, and it has a language override, that override gets displayed - otherwise it just displays $promotiondescription... it;s only a rough suggestion that you might not need, but it's expandable to whatever you want it to display.

Cool, I have implemented it like this as for multiple promos this would be ideal 🤩

20 hours ago, brian! said:

the above would work.. as would the code below...

Great, after loads of testing etc that works a dream now.

20 hours ago, brian! said:

there is a coding-free method to do this (if you're orderform template supports it), you could use either the "Headline" or "Tagline" options within the product group name settings from setup -> products/services -> products/services... edit product group

I am already using the headline/tags so it's not an ideal place to be using it for me. As above implemented it using the different method.

Lastly, what was really bugging me was the fact the promo would be applied to ALL products. SO I have been fiddling around since yesterday (hence the late reply) and think I have found a solution that works (tested it many times and so far its working as I expect.

From what you suggested:

On 8/25/2018 at 7:52 PM, brian! said:

<form id="frmConfigureProduct"> <input type="hidden" name="configure" value="true" /> <input type="hidden" name="i" value="{$i}" /> <input type="hidden" name="promocode" value="manchester" />

I actually changed that around a little. So that it now looks like this:

 <form id="frmConfigureProduct">
                <input type="hidden" name="configure" value="true" />
                <input type="hidden" name="i" value="{$i}" />
                {if $productinfo.type eq "hostingaccount"}<input type="hidden" name="promocode" value="MYPROMOCODE" /> {/if}

So I ended up fiddling around quite a bit to get it to work using many different variations. Eventually, I added the following IF statements wrapped around my form input:

{if $productinfo.type eq "hostingaccount"}<input type="hidden" name="promocode" value="MYPROMOCODE" /> {/if}

and now that only shows when its a hosting product. I guess you could also use else if statements for different types e.g server etc to further modify it but for now, it's working a dream and has saved me using promocode via external URL and it being used on ALL products  🤑

That may end up helping someone else!

THANK YOU for your input. its been very helpful to get what I needed to be done 🤓 

Link to comment
Share on other sites

  • 1 year later...

I believe this post highlights tad bit on what I am looking to do...  I do net 30 web hosting and want a promo code that can cause the system to take the monthly fee, use my net60 terms instead and when promotion is over I switch them back to net30. I still want to charge the setup fee, just not the monthly fee until 60 days from now. I also only want to offer this to 2 plans. 

Link to comment
Share on other sites

14 hours ago, cmshosting said:

I do net 30 web hosting and want a promo code that can cause the system to take the monthly fee, use my net60 terms instead and when promotion is over I switch them back to net30. I still want to charge the setup fee, just not the monthly fee until 60 days from now. I also only want to offer this to 2 plans. 

so a product (or two) that charges a setup fee, but uses a promo code to make the first 2 months free (recurring=1) and then charges monthly as normal ?

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.

×
×
  • 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