Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

CB Code Field

  • andyv
  • andyv
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
5 years 11 months ago #309038 by andyv
CB Code Field was created by andyv
Hi,
I have 2 questions:
1. where to find "Update on" option in the CB Code as there is no documentation at all?
2. I'm trying to achieve:
- during the registration unique 8 digit number generated used for membership payment
- remain this number and do not allow to the user change it at all

I was trying to generate number using PHP, but when checking strlen(cb_myfield) -- the code field itself - it always returns 0 so the code is always executed.
I can generate unique number based on the email address, but the code field needs to be updated dynamically once email address is entered - I don't see the "Update on" option.
Or is there any easy way how to generate unique number for the user just once?

thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
5 years 11 months ago #309052 by krileon
Replied by krileon on topic CB Code Field

1. where to find "Update on" option in the CB Code as there is no documentation at all?

Update On is deprecated in CB Code Field. Use the Update On feature in CB Core Fields Ajax as it can work with any fieldtype.

Or is there any easy way how to generate unique number for the user just once?

They already have a unique number via [user_id]. Aside from that yes you can use a CB Code Field, but you don't need the Update On usage for it. Suggest generating a unique number based off the user id, which will never change. Could be as simple as an md5 of user id + a secret key. Example as follows.

Code:
return substr( md5( '[user_id]_SECRET_KEY' ), 0, 8 );

Replace SECRET_KEY with something only you would know or at least something not easily guessed.


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.

  • andyv
  • andyv
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
5 years 11 months ago #309064 by andyv
Replied by andyv on topic CB Code Field
Thanks, will give a try. One thing on the code - it will work only for existing users, right? So it can't be used during registration.

the thing I want to achieve is to generate a 8 to 10 digit which will be used for bank wire transfer / payment identification during the registration process.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
5 years 11 months ago #309079 by krileon
Replied by krileon on topic CB Code Field

Thanks, will give a try. One thing on the code - it will work only for existing users, right? So it can't be used during registration.

Correct.

the thing I want to achieve is to generate a 8 to 10 digit which will be used for bank wire transfer / payment identification during the registration process.

You may want to consider using CBSubs in that case to accept online payments. Stripe gateway supports ACH Credit Transfers, which are just wire transfers.

If they don't need to send payment at same time as registration you could just provide them their ID number (your code field) after they've registered, which will work fine. This likely could just be a part of the registration complete message shown after registering using language overrides feature below to override it and add your code field to it.

www.joomlapolis.com/blog/kyle/18701-language-overrides-have-arrived


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.

Moderators: beatnantkrileon
Powered by Kunena Forum