How to add a picture in costume fields

  • Posts: 7
  • Thank you received: 0
12 years 10 months ago #43305

Hi,
I have a store that sells various materials, they have height, width and texture.

I did variations of height and width but 160 came on the product, according to this price is determined.

Now I need to add texture that does not cost anything but a picture need to appear when you select a texture.

Any ideas how to do?

Many thank's.

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

  • Posts: 7
  • Thank you received: 0
12 years 10 months ago #43309

To be more explicit it is the link:
www.sunshadow.eu/produse/basic-shop/prod...ine-retractabile-sun

And I create custom field "tesatura" had to allocate according to the vaule the picture

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

  • Posts: 83103
  • Thank you received: 13417
  • MODERATOR
12 years 10 months ago #43481

You will have to edit the file show_block_custom_item via the menu Display->Views and add some javascript code in the "onchange" attribute of the custom field in order to display the image you want when the selection changes.

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

  • Posts: 7
  • Thank you received: 0
12 years 10 months ago #43522

Ty,
But i'm not very good at js u can give me 1 example ?

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

  • Posts: 83103
  • Thank you received: 13417
  • MODERATOR
12 years 10 months ago #43698

Basically, you need to display the div where you have the image for the current selection and hide the others.
to display the div of the current selection, you can do like that:

onchange="document.getElementById('div_'+this.value).display='block';"

So if the image is in a HTML div with the id div_myimage and the value of the selection should be myimage with that example. You will also need additional code to hide the other div like that:
document.getElementById(other_div_id).display='none';

The following user(s) said Thank You: aa211

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

  • Posts: 7
  • Thank you received: 0
12 years 10 months ago #43814

Hi Nicolas,
Thank you for prompt support, I managed to solve the problem with your support
hika shop is actually really good and with some adaptations for our specific I think we will do a really good work...

We haven't finished yet if we have more problems we will bother you with some questions that we will have :)

All the best.

Last edit: 12 years 10 months ago by aa211.

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

Time to create page: 0.039 seconds
Powered by Kunena Forum