News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

product image in add to cart popup

Started by r_ekkie, May 25, 2014, 19:43:30 PM

Previous topic - Next topic

r_ekkie

Is it possible to add the product image in the add to cart popup.
tried some things in padded.php but it's not giving me the image.

Thanks

itsyours

I need it too...please help us :) i have tried add: <?php echo $this->product->images[0]->displayMediaFull('class="product-image"',false?> but nothing :(

seyi

You can do it, but you first have to load the image into the object and then you can call the image, something like this:


<?php
if (!class_exists('VmImage')) require(JPATH_VM_ADMINISTRATOR DS 'helpers' DS 'image.php');
$productModel VmModel::getModel('product');
$productModel->addImages($this->products,1);

echo 
'<a class="continue" href="' $this->continue_link '" >' JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
echo 
'<a class="showcart floatright" href="' $this->cart_link '">' JText::_('COM_VIRTUEMART_CART_SHOW') . '</a>';
if(
$this->products){
foreach($this->products as $product){
echo '<h4>'.JText::sprintf('COM_VIRTUEMART_CART_PRODUCT_ADDED',$product->product_name,$product->quantity).'</h4>';
echo $product->images[0]->displayMediaFull('class="product-image"',false);
}
}
?>

Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

r_ekkie

Thanks that works great.

I only needed this bit:
if (!class_exists('VmImage')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php');
$productModel = VmModel::getModel('product');
$productModel->addImages($this->products,1);

if($this->products){
foreach($this->products as $product){

echo $product->images[0]->displayMediaThumb('class="product-image"',false);
}
}


the only thing I'm facing is that I want the image to be in the center instead of on the left. Tried a lot in Firebug but haven't found the right code. Any idea?

seyi

Hello,

You could try something like this for the image code

<?php
echo $product->images[0]->displayMediaThumb(' class="product-image" style="display:block;margin:0 auto;" ',false);
?>

Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate