Thanks again, for your quick and informative reply.
I actually managed to solve the problem without having to write my own module to override the functions of the
ProductVariants addon. Instead I created a custom template to override
theme_tweaker/customer/items_list/product/parts/common.product-thumbnail.twig
Code:
<a
href="{{ this.getProductURL(this.categoryId) }}"
class="product-thumbnail">
{{ widget('\\XLite\\View\\Image', lazyLoad=true, image=this.product.getImage(), maxWidth=this.getIconWidth(), maxHeight=this.getIconHeight(), alt=this.getIconAlt(), className='photo') }}
</a>
becomes...
Code:
<a
href="{{ this.getProductURL(this.categoryId) }}"
class="product-thumbnail">
{{ widget('\\XLite\\View\\Image', lazyLoad=true, image=this.product.getProductImage(), maxWidth=this.getIconWidth(), maxHeight=this.getIconHeight(), alt=this.getIconAlt(), className='photo') }}
</a>
Essentially replacing the function call
this.product.getImage() with
this.product.getProductImage().
This changes the behaviour on the front page and category pages, but not on the product listing page itself, which is exactly the behaviour I am after.
Thank you for pointing me in the right direction. It was in reviewing the function definition you pointed out that I was able to notice the
getProductImage() function, and try calling that from the template.