In file templates\YOUR_TEMPLATE\html\com_virtuemart\cart\padded.php
After the code:
if($this->products){
foreach($this->products as $product){
if($product->quantity>0){
Add next code:
/* Add images to product */
if (!class_exists( 'VmModel' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'vmmodel.php');
$productModel = VmModel::getModel('Product');
$productModel->addImages($product);
/* Display first image */
echo($product->images[0]->displayMediaThumb('class="browseProductImage"', false));
-----
Yegor Kaliberda
Does not work on my VM 3.0.14. Popup never displays, indicating a php error.
Anyone care to review the code to make it work ? I would also love to have the modal to show images.
Cheers,
prokop
This works for me on 3.0.16:
VmModel::getModel('Product')->addImages($product);
echo $product->images[0]->displayMediaThumb('class="popupProductImage"', false);
prokops
post your configuration - you are having issues with displaymediaThumb
Check php and Vm versions etc
It seems the fault was on my outdated "padded.php" in my html override folder.
I corrected the mistake and now it works! Thanks a lot, problem solved :)
thank you for the update