Author Topic: Generic Child Variant Images  (Read 881 times)

skawars

  • Beginner
  • *
  • Posts: 4
  • A beginner
Generic Child Variant Images
« 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


Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2284
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Generic Child Variant Images
« Reply #1 on: July 13, 2018, 13:48:53 pm »
Is your template up to date? Talk with your template developer.
Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

skawars

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: Generic Child Variant Images
« Reply #2 on: July 13, 2018, 14:42:12 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?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3955
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Generic Child Variant Images
« Reply #3 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8940
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Generic Child Variant Images
« Reply #4 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?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2284
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Generic Child Variant Images
« Reply #5 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
That tells the whole story, is this included in your template ?
If not, it might be the problem.

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

skawars

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: Generic Child Variant Images
« Reply #6 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