Charackteristic Parameters

  • Posts: 10
  • Thank you received: 0
9 years 11 months ago #183267

-- HikaShop version -- : HikaShop Starter: 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.40
-- Browser(s) name and version -- : Firefox 34.0

Hello Everybody,

I am searching for a way to add some images to charackteristics. In the table:

#_hikashop_characteristic

there is a field:
characteristic_params

But that one is empty for each charackteristic I have created. In the edit Popup for a certain Charackteristic, I can only edit the name of the chrackteristic, it is not possible to set any of the parameters.

Is there a plugin or way to make that work?

Thanks in Ahead!

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 11 months ago #183298

Hi,

I am sorry but I don't understand what you're trying to perform.
Images are in the table #__hikashop_file and are related to the products (variants included).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
9 years 11 months ago #183321

Hey Jerome,

to give an example: I have a product with three characteristics, about ten possibilities each, what generates about 1000 variants. By default the characteristics appear as drop down list on the product page, so in my case there are three drop down lists, one for each characteristic.

I would like to gererate three Grids of links (one Grid per characteristic) whereby there should appear an image next to the name of the characteristic. So if one of the characteristics is a color and one of the possible colors is red, than there should appear a link which includes an image that shows the red color and the word "red" next to it.

I could already manage to generate the Grids of links and now I am searching for a way to decorate each single characteristic.

Therefore I had a look at the database and found the field characteristic_params empty, so I thought this one might be a good place to add the link to the image there, but there is no interface for entering any values.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #183349

Hi,

I think that this is what you are looking for: ;)
www.hikashop.com/support/support/documen...isplay-by-color.html

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
9 years 11 months ago #183659

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…

Last edit: 9 years 11 months ago by philipp.

Please Log in or Create an account to join the conversation.

Time to create page: 0.076 seconds
Powered by Kunena Forum