Post by Zarco » Tue Jul 19, 2011 5:11 am

Hi,
I'm new in the forum, so hello everyone !!!

I don't know if here if the right place to post this question, if it isn't please move it to the right place...

My problem is the following, I hope someone can help me...

I Will like to make an automátic discount to the costumers who do registering in my shop.
I have already created a customer group called " registered customers" and I have make a general discount in it.

The problem is that I don't know how to make customer change automatic from the "default group" to "registered customers" group once he has made the registration.

I do not want to do it manually becouse I would like customer haven't to wait until he is able to buy with the discount.
Also don't want to apply the discount in the default group becouse I don't want not registered people see all the discount prices.

Anyone knows a module or a modification to do this ??

Thanks a lot !

New member

Posts

Joined
Mon Jul 18, 2011 6:42 am

Post by uksitebuilder » Thu Jul 21, 2011 4:17 am

I think this may work for you:

open: catalog/model/account/customer.php

find:

Code: Select all

      	$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET store_id = '" . (int)$this->config->get('config_store_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', password = '" . $this->db->escape(md5($data['password'])) . "', newsletter = '" . (isset($data['newsletter']) ? (int)$data['newsletter'] : 0) . "', customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "', status = '1', date_added = NOW()");

inline find:

Code: Select all

" . (int)$this->config->get('config_customer_group_id') . "
Replace with the id of your registered customer group.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Zarco » Thu Jul 21, 2011 5:00 am

Hello,

Thanks for your answer !

I've tried but it doesn't work... when I try to register it break down and show a white page. ;D

I hope I've understood the change you indicate...

I've replaced all this sentence ". (int)$this->config->get('config_customer_group_id') ." for the customer group id that in my case is "8" is that ok or I've miss understood you.

Thanks!!

New member

Posts

Joined
Mon Jul 18, 2011 6:42 am

Post by Zarco » Thu Jul 21, 2011 5:05 am

Sorry...

was my mistake... I forget to replace " " also

It works fine now

Thanks very much !!

New member

Posts

Joined
Mon Jul 18, 2011 6:42 am

Post by stevenshih » Wed Feb 22, 2023 6:08 pm

I also need this funtion as the subject, however my opencart verion is 3.0.3.
I can't find where to modify the code correctly...

Live Women


Newbie

Posts

Joined
Tue Dec 13, 2022 1:38 pm
Location - Usa
Who is online

Users browsing this forum: No registered users and 4 guests