Post by Alzow » Sun Oct 12, 2014 4:18 pm

Hi,

I am trying to change the 'Business Type' radio button on the account registration page to a drop down menu. I have tried searches but couldn't find an answer. I'm using V1.5.6 with the default theme.

Can anyone point me in the right direction?

Thanks,

Alzow

Newbie

Posts

Joined
Sun Oct 12, 2014 4:08 pm

Post by alin » Mon Oct 13, 2014 9:01 pm

I write here for default template

Edit this file catalog/view/theme/default/template/account/register.tpl

Find (from line 61 to line 71)

Code: Select all

<td><?php foreach ($customer_groups as $customer_group) { ?>
            <?php if ($customer_group['customer_group_id'] == $customer_group_id) { ?>
            <input type="radio" name="customer_group_id" value="<?php echo $customer_group['customer_group_id']; ?>" id="customer_group_id<?php echo $customer_group['customer_group_id']; ?>" checked="checked" />
            <label for="customer_group_id<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></label>
            <br />
            <?php } else { ?>
            <input type="radio" name="customer_group_id" value="<?php echo $customer_group['customer_group_id']; ?>" id="customer_group_id<?php echo $customer_group['customer_group_id']; ?>" />
            <label for="customer_group_id<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></label>
            <br />
            <?php } ?>
            <?php } ?></td>
Replace with

Code: Select all

<td><select name="customer_group_id">
			<?php foreach ($customer_groups as $customer_group) { ?>
				<?php if ($customer_group['customer_group_id'] == $customer_group_id) { ?>
					<option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
				<?php } else { ?>
					<option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
				<?php } ?>
			<?php } ?>
		  </select></td>
Find (around line 197)

Code: Select all

$('input[name=\'customer_group_id\']:checked').live('change', function() {
Replace with

Code: Select all

$('select[name=\'customer_group_id\']').live('change', function() {

GOLDEN LEOPARD SYSTEM SOLUTION
An ICT System Solution Company in Vietnam
Website: Store: http://opencart.goleo.vn or http://www.opencart.com/index.php?route ... rname=alin


User avatar
Active Member

Posts

Joined
Fri Jun 10, 2011 8:16 pm

Post by Alzow » Mon Oct 13, 2014 9:29 pm

Alin,

Thanks for your help, I amended the code, uploaded and tested it and it works perfectly!

Thanks, again.

Newbie

Posts

Joined
Sun Oct 12, 2014 4:08 pm
Who is online

Users browsing this forum: No registered users and 38 guests