News:

Support the VirtueMart project and become a member

Main Menu

Change image no reload product variant

Started by SMoll, September 05, 2013, 13:57:30 PM

Previous topic - Next topic

SMoll

Hello I'm looking for a way to change the product image when selecting a custom cart variant field option without reloading the page.

For example I have a T-shirt in two colors, the basic color and a variant, then I'll make a product T-shirt with a child product in a other color and make a product variant custom field with. When you then select the color variant it not only changes the price but also the main product image without a page reload.

I have tried the Generic child variant but that reloads the page the Cart variant custom field works nice but doesn't change the image, so it would be nice to hack the custom field cart product variant in this way that when selecting a product variant it would change the image.

Also I don't necessarily need to be able to keep stock.

I imagine it could work like this; through PHP it would read the product ID and combine it with the cart variant value witch would correspond with a image name and JavaScript would refresh the product image.

Thanks in advance,
Greetings,
Santana

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

SMoll

Does anybody know if there's any info on this subject here on the forum or should I check a PHP forum for this kind of question.

Although I think it would be a great feature to have so if we could gather some info on this would be nice and share it here.

Greetings,

Maxim Pishnyak

Quote from: Maxim Pishnyak on September 05, 2013, 19:43:35 PM
Why it is so huge problem with reload?
I don't get why it will be so nice feature, if it's already not a big problem with working reload.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

SMoll

I agree with you Maxim, it is not a huge problem, but it just takes unnecessary seconds (4 or 5seconds) to load the hole same page and images except one image, that makes it inefficient.

So it would make a faster site and a nicer way for a customer to click on a product variant. If looking at a variants will take 5 seconds, say you have four variants takes allmost half a minute I think it is a bad experience for a buyer.


Maxim Pishnyak

#5
Actually I do my best to improve loading speed after my web shop is built. But in your case you could do this now. Did you make a research what are your time wasters: images, css, scripts ...?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart