Post by Glowstick » Sat Aug 11, 2018 7:38 pm

Hi

We needed to create a second account/register page - which we have done successfully. It works fine.

However, we need customers who register on this page to be placed into Customer Group (ID 4) automatically.

I've been playing around in our duplicate register.php file with no luck. Would this be the line to change?

Any help would be appreciated.
$this->config->get('config_customer_group_id')
$this->load->model('account/customer_group');

$this->data['customer_groups'] = array();

if (is_array($this->config->get('config_customer_group_display'))) {

$customer_groups = $this->model_account_customer_group->getCustomerGroups();

foreach ($customer_groups as $customer_group) {

if (in_array($customer_group['customer_group_id'], $this->config->get('config_customer_group_display'))) {

$this->data['customer_groups'][] = $customer_group;

}

}

}

if (isset($this->request->post['customer_group_id'])) {

$this->data['customer_group_id'] = $this->request->post['customer_group_id'];

} else {

$this->data['customer_group_id'] = $this->config->get('config_customer_group_id');

}

Newbie

Posts

Joined
Wed Nov 29, 2017 4:10 pm

Post by rjcalifornia » Sun Aug 12, 2018 9:04 am

Glowstick wrote:
Sat Aug 11, 2018 7:38 pm
Hi

We needed to create a second account/register page - which we have done successfully. It works fine.

However, we need customers who register on this page to be placed into Customer Group (ID 4) automatically.

I've been playing around in our duplicate register.php file with no luck. Would this be the line to change?

Any help would be appreciated.
$this->config->get('config_customer_group_id')
$this->load->model('account/customer_group');

$this->data['customer_groups'] = array();

if (is_array($this->config->get('config_customer_group_display'))) {

$customer_groups = $this->model_account_customer_group->getCustomerGroups();

foreach ($customer_groups as $customer_group) {

if (in_array($customer_group['customer_group_id'], $this->config->get('config_customer_group_display'))) {

$this->data['customer_groups'][] = $customer_group;

}

}

}

if (isset($this->request->post['customer_group_id'])) {

$this->data['customer_group_id'] = $this->request->post['customer_group_id'];

} else {

$this->data['customer_group_id'] = $this->config->get('config_customer_group_id');

}
Check this thread:

viewtopic.php?t=36356

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by Glowstick » Sun Aug 12, 2018 3:27 pm

Hi :)

Thanks so much for taking the time to assist. It works, but I need the customer to be placed into ID 4 on the second register page only, this fix seems to override my default register page too.

The default page allows customers to choose their Group, with this change, they are put into group 4 no matter what they select

The second register page needs to place them in ID 4 automatically.

Newbie

Posts

Joined
Wed Nov 29, 2017 4:10 pm

Post by rjcalifornia » Mon Aug 13, 2018 5:17 am

Glowstick wrote:
Sun Aug 12, 2018 3:27 pm
Hi :)

Thanks so much for taking the time to assist. It works, but I need the customer to be placed into ID 4 on the second register page only, this fix seems to override my default register page too.

The default page allows customers to choose their Group, with this change, they are put into group 4 no matter what they select

The second register page needs to place them in ID 4 automatically.
Looks like you have to do a check, and see where the data is coming from. If it comes from the second page, set the ID 4, else use the selected option

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide
Who is online

Users browsing this forum: edkny, Semrush [Bot] and 122 guests