Jump to content

How can i change default customer group for multiple customers


Recommended Posts

Prestashop Version: 1.6.1.5

 

Hey everyone,

I have following important groups in my shop (with a ton of customers):

  • Customer (by default from Prestashop)
  • Limit 1000
  • Limit 3000
  • Limit 5000

Every customers "Default group" is set to "Customer". I need it to be set to the specific "Limit" group, in which they're in. I think the only way to achieve this is with some SQL command, but my knowledge there is very limited. 

Can someone help me out?

 

Link to comment
Share on other sites

I found the answer. Following SQL String works perfectly:

update prstshp_customer
join
(
SELECT
  c.id_customer AS id_customer,
  id_gender,
  firstname,
  lastname,
  c.email AS email,
  birthday,
  date_add,
  c.active AS active,
  a.id_group
FROM prstshp_customer_group a
LEFT JOIN prstshp_customer c
  ON (a.id_customer = c.id_customer)
WHERE 1
AND a.id_group = 4
AND c.deleted != 1
AND c.id_shop IN (1)
)B on prstshp_customer.id_customer=B.id_customer
SET id_default_group=4

 

Just change

AND a.id_group = 4

to the ID of the group in which the customers are.

and the default group ID

SET id_default_group=4

u want to assign to that customers

 

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...