Jump to content

[SOLVED] auto assign a group to a costumer on registration


Fadyselim

Recommended Posts

how can i automatically assign a user on registration to a group based on what they have filled in as their hometown (or city as it is called here)

currently i have 2 groups which i use, one is 'hilversum' with id 4 and the other one is the costumer group with id 3. what i want is that if costumers type in "hilversum" in the city box, that they will be automatically assigned to the group "hilversum" and if not then in the costumer group.

 

can anyone help me achieve this? i do know my fair share of programming but i just can't seem to find out how to solve this problem.

 

thanks in advance

Edited by Fadyselim (see edit history)
Link to comment
Share on other sites

you would have to create a module that listens(hooks) the new account process, and then implement the logic you stated above. I have a customer group registration module that allows the customer to choose which group to join during registration.

 

If you are familiar with php and prestashop coding, you could purchase my module and modify it to suite your needs. Or you could hire a developer to create the module for you.

 

For more details on my module, you can visit this link

http://www.bellini-services.com/shop/18-customer-group-registration.html

Link to comment
Share on other sites

well i can code it myself because i am pretty familiar with php and all that stuff and after some digging I think I know how to achieve this but what i need to know still is how to listen to account creation... how to trigger my php script when an account is created

Link to comment
Share on other sites

well i can code it myself because i am pretty familiar with php and all that stuff and after some digging I think I know how to achieve this but what i need to know still is how to listen to account creation... how to trigger my php script when an account is created

 

in ps you use hooks to gain control...

as we don't' know you ps version...find the version doc for yours

 

https://www.google.com.co/search?q=prestashop+doc+hooks&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

 

also if you expect someone to help you..then take a little time to tell the community your ps version...1.4 and 1.5 are very different on how you would do this...I could post code exactly on how to hack it...but I am not going to do it 'ever' when i dont' know the version..

 

there are also paid modules that already do this..

 

it's a good idea NOT to search using the forum tool for answers...if they forum search work better than google, they would be google.

 

good luck

  • Like 2
Link to comment
Share on other sites

wow easy man sorry, i did not mean to offend anyone... i trief searching but i could not come up with a clear way of achieving this since i have never actually created a module... I can try but that is going to take time which i do not have anymore i am afraid... my prestashop version is 1.5.2.0

 

so maybe if you would still be so kund as to help me with this, then you have my thanks in advance...

Link to comment
Share on other sites

  • 1 month later...

Would this module allow me to filter guests and assign them to a group?

 

Thanks for your question. However, it is impossible to filter and assign a guest to a group. You would need some sort of information from them (e.g. name, email, etc.) in order to be able to assign them to a group. In short, they would need to create an account in order to be able to add them to a group.

 

If you have additional questions feel free to ask. You can also download the complete user guide prior to purchasing our module at

1.4.x.x http://prestashop.ca...-and-rules.html or

1.5.x.x http://prestashop.ca...-and-rules.html

 

Marty Shue

Edited by Carolina Custom Designs (see edit history)
Link to comment
Share on other sites

maybe just to clarify, there is a difference between a guest and a visitor in v1.5 of prestashop.

 

a visitor is a person that visits the website, but does not provide any account information (aka, they do not register)

a guest is a person that visits the website, and checkouts as a guest.

 

I would be curious which one bjp is referring to

  • Like 1
Link to comment
Share on other sites

maybe just to clarify, there is a difference between a guest and a visitor in v1.5 of prestashop.

 

a visitor is a person that visits the website, but does not provide any account information (aka, they do not register)

a guest is a person that visits the website, and checkouts as a guest.

 

I would be curious which one bjp is referring to

 

I was referring to a person who purchases and checks out as a guest via instant checkout. However I am using PS 1.4.9, not 1.5 in this situation.

 

The database does record whether a customer entry is a "guest" or otherwise. I just wish there was an easy way to filter for it through back office. If there is, I haven't found one.

 

bjp

Link to comment
Share on other sites

Agreed, in v1.4 you would not easily be able to locate "guest accounts" via the back office. If you are familiar with phpmyadmin, you could search for guest accounts using a query, and the place those customers into a custom "guest group"

 

You could also override the auth controller to place the customer into a custom group if they are checking out as a guest.

Link to comment
Share on other sites

Marty,

 

Would your module be able to assign a person who purchases a specific product to a group automatically? Bellini is familiar with my application as he developed a custom PDF that includes a membership card as a 2nd page to the PDF invoice if a customer purchased a product "Membership". What I'd like to do is have anyone who purchases that product automatically assigned to a group. I currently assign them manually to a group "2013Membership", and keep track of who renews membership annually in these groups. The groups are used for sending Newsletters.

Link to comment
Share on other sites

I was referring to a person who purchases and checks out as a guest via instant checkout. However I am using PS 1.4.9, not 1.5 in this situation.

 

I apologize as I misunderstood what you meant by 'guest'. Restrospect does not natively have this feature but we can certainly modify the module to include the ability to filter guests automatically and add them to your defined group.

 

Marty Shue

Link to comment
Share on other sites

Would your module be able to assign a person who purchases a specific product to a group automatically?

 

As I mentioned above, Retrospect does not include this feature natively but we can certainly modify the module and add the product filter you described. Please let me know if you have interest in this modification.

 

Marty Shue

Link to comment
Share on other sites

I apologize as I misunderstood what you meant by 'guest'. Restrospect does not natively have this feature but we can certainly modify the module to include the ability to filter guests automatically and add them to your defined group.

 

Marty Shue

 

By automatically, do you mean at checkout? That solves half my problem but I also would like to filter my existing customer list for guest, and assign them to a group. Could your module be modified to do both?

 

If yes, PM me the cost?

Link to comment
Share on other sites

Agreed, in v1.4 you would not easily be able to locate "guest accounts" via the back office. If you are familiar with phpmyadmin, you could search for guest accounts using a query, and the place those customers into a custom "guest group"

 

You could also override the auth controller to place the customer into a custom group if they are checking out as a guest.

 

Yes, I did use phpadmin to generate a list of guests. If there is no other option, I can change them all to a group manually, one at a time, it's about 700+, though and it would be helpful if I had a way in back office to expedite. Thanks for your replies, I appreciate your input. :-)

Link to comment
Share on other sites

nah, we could create you a SQL command that would change that list of guests.

 

The ps_customer_group table defines which group a customer belongs to. There are only 2 fields, the customer Id and the group Id.

To add the customer to another group, you simply insert a new record into this table.

 

So if you have the list of customer Ids and you have the group id of your custom group, then for each customer you execute this SQL statement

 

INSERT INTO `PS_CUSTOMER_GROUP` (`id_customer`, `id_group`) VALUES ('1', '2');

Where....

1=customer id

2=guest group

 

And if you want to delete the customer from the default group

DELETE FROM `ps_customer_group` WHERE `ps_customer_group`.`id_customer` = 1 AND `ps_customer_group`.`id_group` = 1

Link to comment
Share on other sites

By automatically, do you mean at checkout? That solves half my problem but I also would like to filter my existing customer list for guest, and assign them to a group. Could your module be modified to do both?

 

Yes, once modified, at the checkout point where an address is typed and save button is clicked the 'guest' would be placed into the relevant group.

 

There are no modifications needed for our module to perform the second half of your request. The existing 'Apply retrospectively' function can be used for existing guests once the guest status filter is added as a filter above.

 

I will PM you the cost for the module and modifications.

 

Marty Shue

Link to comment
Share on other sites

nah, we could create you a SQL command that would change that list of guests.

 

The ps_customer_group table defines which group a customer belongs to. There are only 2 fields, the customer Id and the group Id.

To add the customer to another group, you simply insert a new record into this table.

 

So if you have the list of customer Ids and you have the group id of your custom group, then for each customer you execute this SQL statement

 

INSERT INTO `PS_CUSTOMER_GROUP` (`id_customer`, `id_group`) VALUES ('1', '2');

Where....

1=customer id

2=guest group

 

And if you want to delete the customer from the default group

DELETE FROM `ps_customer_group` WHERE `ps_customer_group`.`id_customer` = 1 AND `ps_customer_group`.`id_group` = 1

 

Thanks for this! I need to become educated in SQL queries, for the time being I'm erring on the side of caution (since I don't truly know what I am doing), but your suggestion is very helpful.

 

thank you :)

 

bjp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...