Post by annelim » Fri Aug 17, 2012 8:46 pm

Dear all,

does any one know how to change the below code from checkbox into select dropbox like manufacturer ?
please help. why i need to change because the category all the way down and sometime the product was miss check into 2 different category. to avoid it i found below code. i had try to change it into select but it was not work when i click select it doesn't save into the category. this is original code.

<td><?php echo $entry_category; ?></td>
<td><div class="scrollbox">
<?php $class = 'odd'; ?>
<?php foreach ($categories as $category) { ?>
<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
<div class="<?php echo $class; ?>">
<?php if (in_array($category['category_id'], $product_category)) { ?>
<input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" checked="checked" />
<?php echo $category['name']; ?>
<?php } else { ?>
<input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" />
<?php echo $category['name']; ?>
<?php } ?>
<?php } ?>
<a onclick="$(this).parent().find(':checkbox').attr('checked', true);"><?php echo $text_select_all; ?></a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);"><?php echo $text_unselect_all; ?></a></td>

Active Member


Fri Oct 28, 2011 5:13 pm
Who is online

Users browsing this forum: No registered users and 85 guests