[SOLVED] Images of other products not available on productdetails template?

Started by TeeJay.net, June 02, 2014, 15:51:03 PM

Previous topic - Next topic

TeeJay.net

Hello,
I've tried writing a simple module to show specific products. Just to make it simple, I did it all in the template.

The most problematic is this part of code:

$productImage = $altProduct->images[0]->displayMediaThumb('class="browseProductImage"', false);


On the productsdetails template, you can access
$product->images property, however, if I use vmmodel to find some specific products, the ->image property is not available, therefore, I can't load images to the found products.
I can access prices and names without any problems, though.

Do I have to write a module that will compile somehow before the page has loaded (that seems to be more like a plugin) or did I something wrong?

Is something wrong with the way I wrote it or it's just because this can't be written into the template? (of course I use overrides)

Thank you for any information!


Edit:// Figured out the solution myself, thank you anyway.
http://docs.virtuemart.net/api-vm2/db/d45/class_vm_model.html#a322595877ba4f67e1bd1f98b578f0ac0