Hello Xavier,
thanks a lot for the reply! I have not known about that tutorial and you are to 80% right that this is what I am looking for, but not completely…
As noted in the example (third post of this thread), I need more than just an image, the name of the characteristic and probably more data, i. e. the content of the alt attribute and so on.
But I could already manage to solve that and I would like to share how I did it. The idea is quite simple: I changed the administration form of the characteristics, so that a new input field appears.
So changed the file*:
~/administrator/components/com_hikashop/views/characteristic/tmpl/normal.php
* ~ stands for the root directory of joomla
so that the contents looks like this:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.4
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<table class="admintable table" width="280px" style="margin:auto">
<tr>
<td class="key">
<?php echo JText::_( 'HIKA_NAME' ); ?>
</td>
<td>
<input id="characteristic_value" type="text" name="<?php echo $this->characteristic_value_input;?>" value="<?php echo $this->escape(@$this->element->characteristic_value); ?>" />
<?php if(isset($this->characteristic_value_published)){
$publishedid = 'published-'.$this->characteristic_value_id;
?>
<span id="<?php echo $publishedid; ?>" class="spanloading"><?php echo $this->toggle->toggle($publishedid,(int) $this->characteristic_value_published,'translation') ?></span>
<?php } ?>
</td>
</tr>
<!-- I added this row -->
<tr>
<td class="key">
<?php echo JText::_( 'HIKA_PARAMS' ); ?>
</td>
<td>
<!-- please not the name »characteristic_params« matches the name of colum in the database-->
<textarea
id="characteristic_params"
name="data[characteristic][characteristic_params]"><?php echo $this->escape(@$this->element->characteristic_params); ?></textarea>
</td>
</tr>
</table>
By doing this, your are done! I adds a textarea to each each characteristic, therein one can enter whatever one disieres. The take-away here is, that the entered Data is automatically stored in the database! I had already coded a plugin to store the data to the database, but during debugging I realizied that hikashop already did that for me and removed the plugin…
All in all, now I have an extra text area for each characteristic and therein I can save data, probably formatted as JSON and with that at hand I can add structured DATA just as I need it…