VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: skawars on July 13, 2018, 13:29:24 PM

Title: Generic Child Variant Images
Post by: skawars on July 13, 2018, 13:29:24 PM
Hi All,

First of all the site is using:

Joomla! 3.8.7
VirtueMart 3.2.12
PHP 5.6

I've done a product import and I'm having some issues getting the child product image to display when using generic child variant. The example is here: http://31.24.106.193/~dyvels/index.php/bed-and-bath/bathroom-accessories/pouch-cube-iona-detail

The the parent product displays, and shows the 1 image attached to the parent.

The problem is when selecting a child product from the select box, say Pouch Cube Iona Litchi for example. The product information updates, but the image does not change. In the VM Admin area the child product has 2 images of its own, but the site is still showing the image for the parent product and not the child?

I've noticed if do a refresh on the page, it updates the image so do I need to manually trigger a page load whenever the select box is used?

Thanks

Title: Re: Generic Child Variant Images
Post by: Jörgen on July 13, 2018, 13:48:53 PM
Is your template up to date? Talk with your template developer.
Jörgen @ Kreativ Fotografi
Title: Re: Generic Child Variant Images
Post by: skawars on July 13, 2018, 14:42:12 PM
Quote from: Jörgen on July 13, 2018, 13:48:53 PM
Is your template up to date? Talk with your template developer.
Jörgen @ Kreativ Fotografi

I am the template developer.

It's a template override of the product details template, but the default_images.php file hasn't been changed other than to add a css class work with the latest version of fancybox, and I was still having this issue before making any changes to this part of the template.

Is this normal functionality of virtuemart? It seems the product descriptions etc update without a page load, but the images do not?
Title: Re: Generic Child Variant Images
Post by: Studio 42 on July 13, 2018, 14:48:23 PM
The class selector certainly not select all the product render, si i think it's because this that your image is not updated.
You have perhaps to modify or add the class in your default.php file override i think by default, class is productdetails-view
Title: Re: Generic Child Variant Images
Post by: GJC Web Design on July 13, 2018, 14:49:52 PM
the image if different does load for children, basically the selection causes an ajax call  (if ajax enabled) or a new call to the child which is a separate product with all its own elements

check at a code level what is being returned in the $this->product->images object -- is it the child image?
Title: Re: Generic Child Variant Images
Post by: Jörgen on July 13, 2018, 15:40:49 PM
A sensible override of the template of 3.2.12 should work. Older templates miss the class studio42 is talking about. I gave had no issues with child products not changing images. There is a note
http://virtuemart.net/news?start=5 (http://virtuemart.net/news?start=5)
That tells the whole story, is this included in your template ?
If not, it might be the problem.

Jörgen @ Kreativ Fotografi
Title: Re: Generic Child Variant Images
Post by: skawars on July 13, 2018, 17:09:46 PM
Thanks for your responses everyone.

I first of all replaced some of the VM classes that surround the product as suggested, with no change.

I then noticed in the inspector window when I remove the template override there was a lot of extra JS at the bottom of the page, and after comparing the original default.php to my template override, I had removed the JS at the bottom to make the AJAX update work.

All working now!
Cheers