Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Problem with CBSubs CB Field date field substitition

  • mustards
  • mustards
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
11 years 6 months ago - 11 years 6 months ago #224259 by mustards
Version info:
Joomla 2.5.9
CB 1.9
CBSubs 3.0.0

I want to use CBSubs CB Field to auto update two fields when someone subscribes. One is a text field and this is updated with [PLAN_NAME]. This works fine.

The other is a date field. I want to update this with [SUBSCRIPTION_SIGNUP_DATE]. I get a blank date (ie 0000-00-00 when exported via CBJuice2).

In the Subscriptions list in CBSubs I can see valid Subscription dates.

Can you tell me what I am doing wrong please?
Last edit: 11 years 6 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
11 years 6 months ago #224265 by krileon
Try setting it to a text or textarea field and see if it stores a value.


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 or Create an account to join the conversation.

  • timsimon
  • timsimon
  • ONLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
11 years 6 months ago #225451 by timsimon
Hi
I have the same setup and the same problem. It inserts the date ok into a text field but does not into a date field.
I am using [SUBSCRIPTION_LAST_RENEWAL_DATE] and into a text field I get the date in the format 18/04/2013
Any ideas?
Regards
Tim

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
11 years 6 months ago #225467 by krileon
Looks like CBSubs is applying CB date formatting to it instead of the raw date. Without the raw date it won't store to a date field properly. as 18/04/2013 isn't a database formatted date. Try using the below in an SQL Action using CBSubs SQL Actions to directly insert to database.
Code:
UPDATE `#__comprofiler` SET `cb_date` = STR_TO_DATE( '[SUBSCRIPTION_LAST_RENEWAL_DATE]', '%d/%m/%Y' ) WHERE `user_id` = '[user_id]'

Replace cb_date with your actual field name. Note the above only converts the format DD/MM/YYYY; adjust '%d/%m/%Y' as needed.


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 or Create an account to join the conversation.

  • timsimon
  • timsimon
  • ONLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
11 years 6 months ago #225873 by timsimon
Works perfectly, many thanks
Tim

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum