Hi,
I have added new field into config area to save two category field.
i have write this code into view.html.php-
$main_virtuemart_category = $config->_params['main_virtuemart_category_id'];
$discount_virtuemart = $config->_params['discount_virtuemart_category_id'];
if (isset($main_virtuemart_category)){$main_virtuemart_category_tree = ShopFunctions::categoryListTree($main_virtuemart_category);}else{$main_virtuemart_category_tree = ShopFunctions::categoryListTree();}
$this->assignRef('main_virtuemart_category_id', $main_virtuemart_category_tree);
if (isset($discount_virtuemart)){$discount_virtuemart_category_tree = ShopFunctions::categoryListTree($discount_virtuemart);}else{$discount_virtuemart_category_tree = ShopFunctions::categoryListTree();}
$this->assignRef('discount_virtuemart_category_id', $discount_virtuemart_category_tree);
default_shop.php code-
<fieldset>
<legend>Discount Rules</legend>
<table class="adminform">
<tr>
<td class="key">
<span class="hasTip" title="Main Categories">
Main Categories
</span>
</td>
<td>
<select multiple="multiple" id="main_virtuemart_category_id" name="main_virtuemart_category_id[]">
<option value=""><?php echo JText::sprintf( 'COM_VIRTUEMART_SELECT' , JText::_('COM_VIRTUEMART_CATEGORY')) ; ?></option>
<?php echo $this->main_virtuemart_category_id; ?>
</select>
</td>
</tr>
<tr>
<td class="key">
<span class="hasTip" title="Discounted Categories ">
Discounted Categories
</span>
</td>
<td>
<select multiple="multiple" id="discount_virtuemart_category_id" name="discount_virtuemart_category_id[]" size="10">
<option value=""><?php echo JText::sprintf( 'COM_VIRTUEMART_SELECT' , JText::_('COM_VIRTUEMART_CATEGORY')) ; ?></option>
<?php echo $this->discount_virtuemart_category_id; ?>
</select>
</td>
</tr>
</table>
</fieldset>
value saved into config table but when i open it both dropdown show same selected value
please tell me what i miss?
Thanks in advance
I would say learn the VM API. Show how we use the config. You make it a lot more complex than it is, I would say.