Put CB Subs Expiry date in CB field

9 years 2 months ago #259105 by hac
Hi,

We have a Joomla 3.3.x site with CB 1.9.1 and CBSubs 3.0.0.

In CB I have an Ending Date field (cb_endingdate).

What I want to do, is each time that a user subscribes to a plan I want to update their Ending Date CB field to the plan's expiration date.

I have setup an Auto Action to try and do this, but it isn't working. The field is blank after the user subscribe or renews.

This is my Auto Action settings:
Type: Field
Trigger: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions: [var3] <= 7 (I have 6 plans that have an id of 1 to 6)
[var2] = A
Field: Last Expiry Date (cb_enddate)
Operator: Set (Field=Value)
Value: [var9_expiry_date]

I think the problem may be that the [var9_expiry_date] is a date time field but the cb_enddate is only a date field.

Is there a way to get just the date from [var9_expiry_date] to put into cb_enddate in the Auto Action?

Thank you for your help.

Please Log in to join the conversation.

9 years 2 months ago #259122 by krileon
Replied by krileon on topic Put CB Subs Expiry date in CB field
I recommend using a text field. The date isn't an accurate representation of the users expiration. You also shouldn't need CB Auto Actions for this though as you can use CBSubs Fields and set your fields value to the [SUBSCRIPTION_EXPIRY_DATE] substitution. Note with CB 2.x we have a datetime fieldtype now instead of just date.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.466 seconds

Facebook Twitter LinkedIn