1. voipsystems
  2. General
  3. Tuesday, August 05 2014, 09:45 PM
Hi is posible to have a increment field, that increment automatically on each registration, per example customer_id, and give it an inicial value like 010, then when a new customer is registered, will have 011 automatically, if is posible i can have a fiel text that show the customer_id per example:
Hi, Jose T your id is ${customer_id},
You have 3 examens to do
Is an example, I don't know if is posible, let me know, thanks
Accepted Answer
admin Accepted Answer
Admin
Hi,
sorry for late reply, it was weekend for us

Try This:
- Check if Skeleton plugin is enabled on Extensions->Plugins
- in line $query="SELECT customer_id FROM #__jsn_users ORDER BY customer_id DESC LIMIT 1" missing ";" at the end
- change this from
$data['num_casillero']=$new_casillero;
to
if($isNew) $data['num_casillero']=$new_casillero;
Now save the data only on new user, before save data even on pre-existing user only when they change something on your profile

I have tested and works, so if you have any problem please post me your site details (you can use the form below the reply in Site Details tab)
  1. more than a month ago
  2. General
  3. # Permalink
admin Accepted Answer
Admin
Yes you can do this, but you will write simple plugin based on our Skeleton plugin.

here a plugin and documentation of our Triggers https://www.easy-profile.com/docs/44-triggers.html

You can do something like this:
- Download, install, and enable our Skeleton plugin
- Go on file /plugins/jsn/skeleton/skeleton.php
- delete examples functions triggerFieldAvatarUpdate and triggerProfileUpdate
- write a function like this
triggerProfileUpdate($user,&$data,$changed,$isNew){
// Recognize last customer id
$query="SELECT customer_id FROM #__jsn_users ORDER BY customer_id DESC LIMIT 1"
$db=JFactory::getDbo();
$db->setQuery($query);
$last_customer_id=$db->loadResult();
// Increment customer id value
$new_customer_id=$last_customer_id+1;
// Fill the data variable to store it in DB
$data['customer_id']=$new_customer_id;
}


NOTE: this code is not tested and not supported and require minimum PHP knowledge
  1. more than a month ago
  2. General
  3. # 1
voipsystems Accepted Answer
Hi a question, in these case, the variable is declared in the easy user component or in the DB joomla in users table manually?
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
If you say about "customer_id" column, you can add this as field from Easy Profile component. When you create a field EP create table column with same name of alias field
  1. more than a month ago
  2. General
  3. # 3
voipsystems Accepted Answer
Hi per example i put the code in skeleton (the field in the component is Numero de Casillero (Alias: num_casillero))

triggerProfileUpdate($user,&$data,$changed,$isNew){
// Recognize last customer id
$query="SELECT num_casillero FROM #__jsn_users ORDER BY num_casillero DESC LIMIT 1"
$db=JFactory::getDbo();
$db->setQuery($query);
$last_casillero=$db->loadResult();
// Increment customer id value
$new_casillero=$last_casillero+1;
// Fill the data variable to store it in DB
$data['num_casillero']=$new_casillero;
}

I attached an image of the configuration of the field on easy profile, i tested creating a new customer but the data show, the field is a number, i don't know if need to be a string or something like that

I created a new user (the second new) but i see that doesnt show anything, and in the DB i see the value in null in jnusers
  1. more than a month ago
  2. General
  3. # 4
voipsystems Accepted Answer
Works great thanks, I have my last question, i want to have a tracking systems or tab, with 4 parameters, i can add a row or the customers, you can do that? I know that is not included on the module, is an extra work, can you?
  1. more than a month ago
  2. General
  3. # 5
admin Accepted Answer
Admin
Sorry but we do not work as freelance...but please explain me with more details, maybe it's simple and we can help you to find correct way.
  1. more than a month ago
  2. General
  3. # 6
voipsystems Accepted Answer
Ok per example we want to have a group field
My Packages (tab) when customer press the tab show the packages that has
Values: Description, Courrier, Tracking Number, State, Invoice

And show the list that has, the old and new, maybe if has a lot use pagination per example, the thing is that we want to add packages, and permit to the customer add packages (pre alert), is posible ? Thanks
  1. more than a month ago
  2. General
  3. # 7
voipsystems Accepted Answer
Hi I don't receive any answer since august 13, any advise? Regards
  1. more than a month ago
  2. General
  3. # 8
admin Accepted Answer
Admin
Hi,
sorry for late reply,
half of our staff is in holiday :)

So, your request is too complex for our support, but we are available to create integrations with other components. so if you can find a component that will handle these "Packages", we can carry out the integration.
  1. more than a month ago
  2. General
  3. # 9
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.