0

I am using magento 1.9 version. I need to display customer groups in dropdown option.

I used this code.

It brings the data as dropdown.

My issue is When i use this code some css issues occurs.

By commenting the collection data (ie., line# 4 to line #6) it's working fine.

what is the issue here.

1 Answer 1

0

try below code

<select class=" input-text custgroup required-entry" name="product[tier_price][<?php echo $i; ?>][cust_group]" id="tier_price_row_<?php echo $i;?>_cust_group">
        <option value=''>Select Customer Group</option>
        <option <?php if($tierPrice['cust_group']=='32000') echo 'selected = "selected"';?> value='32000'>ALL GROUPS</option>

        <?php
         $customer = Mage::getModel('customer/group')->getCollection();
        foreach($customer as $type) :?>
        <option <?php if($tierPrice['cust_group'] == $type['customer_group_id']) {echo 'selected = selected"';}?> value="<?php echo $type->getCustomerGroupId();?>">
        <?php echo $type['customer_group_code']; ?>
        </option>
        <?php endforeach; ?>

</select>
1
  • No luck. Same result. I think the issue in foreach only. Commented May 19, 2017 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.