Adding extra months to a plan
I have a plan set up that is set to bill once annually. However, we are running a promotion at launch to encourage customers to purchase the annual plan. When they select the annual plan, they get an additional 3 months free. Here is how I think I am going to handle this in CheddarGetter:
- subscribe the customer to the annual plan
- get the customer, the current invoice billing date and add 3
months to it
- direct customer to the thank you page.
I just wanted to make sure that this was the best way to handle the scenario before writing the code. Is that the correct way to handle it?
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Marc Guyer on 16 Dec, 2010 04:18 PM
Ryan -- that is exactly the technique I'd recommend.
2 Posted by ryan robinson on 16 Dec, 2010 04:35 PM
Thanks for the response. I haven't tried it yet. But, what will happen with the email notifications. Will they get a new subscription notification telling them that their next bill date is in 1 year and then a suscription change notification telling them about the extra 3 months?
Support Staff 3 Posted by Marc Guyer on 16 Dec, 2010 04:58 PM
If you have the new subscription type turned on, they will receive the email at signup. Upon changing the bill date, no email is sent. I'd suggest modifying the email template to specify the correct date (or remove it altogether). You can use the customer meta-data feature to "pass" the correct date to the email template, or you can calculate it within the template.
4 Posted by ryan robinson on 17 Dec, 2010 01:16 AM
So I wrote the code to change the billing date and it works like a charm. However, the confirmation email is an issue. Currently, I just have the default template that sends has the parameter --- {$invoice.billingDatetime|date_format:"%m/%d/%Y"} --- in it. Your code must send the email as soon as the customer is created because it populates it with the old date and sends it to the user. So, two questions:
Thanks.
Support Staff 5 Posted by Marc Guyer on 17 Dec, 2010 02:58 PM
There's two ways to do this.
No worries here.
6 Posted by ryan robinson on 17 Dec, 2010 04:10 PM
Option 2 is going to be best since we will turn the promotion off and on at times. Metadata allows us to put the correct date in depending on the status of the promotion. But, I need your help. I've been trying to get metadata submitted, but it isn't passing it. This is the code for the array I pass to CG:
$CGdata = array(
is that the correct format for inserting metadata?
Support Staff 7 Posted by Marc Guyer on 17 Dec, 2010 05:27 PM
You've got it nested within the 'subscription' key. 'metaData' must be at the root level of the array.
8 Posted by ryan robinson on 17 Dec, 2010 05:51 PM
Rookies:) Thanks.
Dean closed this discussion on 16 Jan, 2013 03:43 PM.