Probably I have not explained the problem very well. We are using hikashop dupRow javascript to add and extra row in the product supplier table. The row we add is
<tr class="row<?php echo $k; ?>" id="hikashop_<?php echo $form_key; ?>_tpl" style="display:none;">
<td class="hikashop_supplier">
<input type="hidden" name="<?php echo $form_key; ?>[{id}][supplier_id]" value="{SUPPLIER_ID}"/>
<a href="<?php echo hikashop_completeLink('supplier&task=edit&cid='.@$supplier->supplier_id); ?>">{SUPPLIER_NAME}</a>
</td>
<?php if($acls['code']){ ?>
<td class="hikashop_supplier">
<input size="10" type="text" name="<?php echo $form_key; ?>[{id}][supplier_product_code]" value="" />
</td>
<?php }
if($acls['currency']){ ?>
<td class="hikashop_currency"><?php
echo $this->currencyType->display($form_key.'[{id}][supplier_currency_id]', '{SUPPLIER_CURRENCY_ID}' , 'class="no-chzn"'); ?>
</td>
<?php }
if($acls['price']){ ?>
<td class="hikashop_price">
<input size="10" type="text" name="<?php echo $form_key; ?>{id}][supplier_product_price]" value="" />
</td>
<?php }
if($acls['active']){ ?>
<td align="center">
<input type="checkbox" name="<?php echo $form_key; ?>[{id}][supplier_active]" value="1" <?php echo !empty($supplier->supplier_active) ? 'checked="checked"' : ''; ?> />
</td>
<?php } ?>
<td>
<a href="#" onclick="window.hikashop.deleteRow(this); return false;"><img src="<?php echo HIKASHOP_IMAGES; ?>delete.png" alt="<?php echo JText::_('HIKASHOP_DELETE'); ?>"></a>
</td>
</tr>
We use the extraData to replace the variables {SUPPLIER_NAME}, {SUPPLIER_ID}, {SUPPLIER_CURRENCY_ID} with the data we get in our addsupplier function (in view.html.php of the product). It all works perfectly. For example we choose a supplier with USD as their currency, {SUPPLIER_CURRENCY_ID} is replace by the value '2'. However if we run a quick test in the function display of the currencyType class, dump_var($value) returns string(22) "2". The value is two, but the string length is 22! Which corresponds to the length of {SUPPLIER_CURRENCY_ID}. So when the Joomla code makes a comparison of the key with the value although it looks like it comparing 2 == 2 really it is comparing string(1) "2" == string(22) "2" and hence it is not showing up as selected.
Any ideas how to make php "forget" the original string and evaluate just the value "2"?