Select image as option of the product(color)

  • Posts: 84
  • Thank you received: 0
11 years 3 months ago #85496

Hello, this is my first post here, writing from Italy.
I just start to use Hikashop and try to create an ecommerce for clothing.
What I need for the product is the possibility to choose the size of the product(t-shirt) from a dropdown menu or radio box and the color by selecting the image of the gallery of the selected product.
Right now I'm able to create both options with dropdown menu but I dont figure out how to select an option by clicking the image.
For better understand you can check this url goo.gl/4zu57

Anyone had experience about and could suggest me some hack?
Thank you in advance
David

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #85553

Hi,

You have to edit the view "product / show_block_img" and add a onClick function on the image.
It require some PHP and Javascript knowledge.

Add a check on the product to see if it has the options, then edit the line concerning the image to put you custom image link, in this link try to add something like: "document.getElementById('monselect').selectedIndex=2" where 2 must be dynamic to be the value of the option.

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

  • Posts: 84
  • Thank you received: 0
11 years 3 months ago #85555

Hello, thank you for your answer.
Unfortunatly I dont have php or javascript knowledge to do this hack.
I supposed there was some plugin/module to integrate this function.

Thank you

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

  • Posts: 84
  • Thank you received: 0
11 years 3 months ago #86095

Hello again.
I figure out to set in the product a dropdown list for selecting color.
When I select the colors from the list, it will show me the correct image.
Instead of list of color, it's simple to use thumb of image?
Suppose in the list I have the color black: when i select black it show immediatly the product with black color.
I need to use, instead of word "black", the thumb of the product with color black.
Obviously I dont need in the list, but in a table(with or without checkbox).

Thank you

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

  • Posts: 81641
  • Thank you received: 13088
  • MODERATOR
11 years 3 months ago #86161

Hi,

You can use a characteristic for that:
www.hikashop.com/en/support/documentatio...html#characteristics
Then, you need to add a characteristic override to convert the dropdown display into selectable images. There is no ready-made solution available for that. However, someone already did it for himself here:
www.hikashop.com/en/forum/2-general-talk...characteristics.html
You could contact him via PM to see if he could share his solution with you for that.

The following user(s) said Thank You: davideventurini

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

  • Posts: 57
  • Thank you received: 2
11 years 2 months ago #91063

Hi,

I'm trying to assist davideventurini in his need to show images for the colours.

I've had a look at the trail of suggestions and attempts. The question I have is, does the over-ride for this function belong in 'hikashop_characteristics.php' or elsewhere, in another over-ride?

Also, in the IMAGES -> array (of stdClass object) there is a [file_path]=> entry. Does this hold the full path to the image, or just the image name - can the entry found here be used as the full source path to the image? i.e. img src="(value stored in [file_path]=>)"

Regards,
Martyn.

The following user(s) said Thank You: davideventurini

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

  • Posts: 81641
  • Thank you received: 13088
  • MODERATOR
11 years 2 months ago #91319

Hi,

It should indeed be in hikashop_characteristics.php

The file_path is only the relative path from the folder media/com_hikashop_upload. It's usually only the filename unless you have images in subfolders.

For the full path of the image in the hikashop_characteristics_html override function it's:
echo $obj->uploadFolder.$element->file_path;

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

Time to create page: 0.094 seconds
Powered by Kunena Forum