Hi, I need to update a user's additional custom field when he signs up using the signup.php AND when he/she upgrades using member.php?tab=add_renew. I guess it would involve sth like this: Code: $user['data']['my_field'] = 'new_value_upon_signup'; but I'm not sure where to insert it. Does this go on the template files using smarty, or on the signup.php and member.php? And where should it be placed? Thanks in advance! p.s. I should add that this is a common field. Then it doesn't need to be added to the database, is that correct?
On the signup form, it should appear automatically in the additional fields settings- if you have it set to be editable and displayed in the signup. Can you explain the usage of this? David
I just meant when a user upgrades from within the account. The field is meant to be like a tracker so it is set to 'don't display'. Thanks.
Still looking for a solution to this... I also opened a support ticket and they are being very helpful, but no solution so far unfortunately. So I wanted to get some thoughts from the community, as well. They suggested using a hook like this: So, the idea is to update the additional field, 'field_name', each time a payment (hence the '$payment['amount']>0') is completed. This would be perfect, however the field is not being updated when I add a subscription to a user on the admin panel. Are we missing anything here? This code is set in site.inc.php as suggested. I should also add that an additional 'common' field is created with the name 'field_name'. I'd appreciate any thoughts.
Also wanted to add that with the above code, I get the error: <b>WARNING:</b> Cannot modify header information - headers already sent by (output started at /home/toganet/public_html/members/site.inc.php:46) in line 238 of file /home/toganet/public_html/members/includes/pear/Services/JSON.php <b>WARNING:</b> Cannot modify header information - headers already sent by (output started at /home/toganet/public_html/members/site.inc.php:46) in line 353 of file /home/toganet/public_html/members/admin/ajax_cnt.php Any ideas, anyone?
I got rid of the above errors by removing the extra spaces at the bottom of site.inc.php. However, the field is still not updated.
In addition, I added these lines and on plugins/protect/plugin_template/plugin_template.inc.php in proper places, and enabled the plugin 'plugin_template' in the cp panel. This is when I got the error: Error. Please configure 'plugin_template' plugin at aMember CP -> Setup -> plugin_template However, on the config settings, we have these fields: It is a simple config field this field will be available as $this_config['cfg_field'] in the plugin code plugin_template Db and Tablename AN EXAMPLE OF COMPLEX FIELD WITH VALIDATION And I'm not sure what goes in these fields, and this is not documented in the manual or else where. Any thoughts, anybody? Alex? Thanks again for your time.
I'm not sure why you need plugin_template enabled. In regards to code in site.inc.php can you copy & paste code that you have in that file currently. Also, screenshot of additiona filed that should be updated settings
Hi laguitar, any resolution on this? I am having the same issue. I cannot get the additional field to update. Using almost the same exact code for the hook.
What type of field you have ? There is a difference between common and sql fields. For common you should use: $member['data']['field_name'] = 'field_value'; for SQL: $member['field_name'] = 'field_value';