VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: pm4698 on September 04, 2014, 11:06:54 AM

Title: [solved] Adding stuff in ajax popup
Post by: pm4698 on September 04, 2014, 11:06:54 AM
Hello there,

I use vm 2.6.x and joomla 2.5.x

I have found this topic: http://forum.virtuemart.net/index.php?topic=91807.0 that some stuff is discussed but inside cart.php i see that cart is loaded with product ids.

What i don't see, is what variables are loading in order to add or remove some (for example, description, quantity, image etc).

What i need to do is just add the image of the product at left or top of description.

Also, i need to move the related products a little bit down but i don't know where to add <br />

Any help appreciated!
Title: Re: Adding stuff in ajax popup
Post by: jenkinhill on September 04, 2014, 11:20:26 AM
In current VM versions the popup is templated. The file is components/com_virtuemart/views/cart/tmpl/padded.php  so you ahould edit that file as you wish and use the edited file as a template override.
Title: Re: Adding stuff in ajax popup
Post by: pm4698 on September 04, 2014, 11:30:35 AM
Thank you very much for your fast reply.

I am trying to add product image (not huge but like thumbnail) but i cannot.

At padded.php i add: echo $product->product_image;

But i cannot see image.

Is there a special variable for thumb image of product?
Title: Re: Adding stuff in ajax popup
Post by: pm4698 on October 01, 2014, 22:25:38 PM
I tried this inside padded.php overrided file inside my template but still i cannot see product image. Any help?

if($this->products){
foreach($this->products as $pkey =>$prow){


echo '<h4>'.JText::sprintf('COM_VIRTUEMART_CART_PRODUCT_ADDED',$prow->product_name,$prow->quantity).'</h4>';
if ( $prow->virtuemart_media_id) {  ?>
<div class="proopc-row">
<?php if(!empty($prow->image)) { ?>
<div class="cart-images">
<?php echo $prow->image->displayMediaThumb('',false); ?>
</div>
                            <? }
}



}
}
Title: Re: Adding stuff in ajax popup
Post by: GJC Web Design on October 02, 2014, 11:11:40 AM
and is this true?  if(!empty($prow->image))
Title: Re: Adding stuff in ajax popup
Post by: pm4698 on October 02, 2014, 19:44:55 PM
For a reason my code doesn't work. Even if i remove this if you are saying, then if i click on add-to-cart button i see the loading graphic and nothing happens. Like coding is wrong. The current code that shows only quantity and title of product is this:

if($this->products){
foreach($this->products as $pkey =>$prow){


echo '<h4>'.JText::sprintf('COM_VIRTUEMART_CART_PRODUCT_ADDED',$prow->product_name,$prow->quantity).'</h4>';                     
}
}


Can you please help me how to make this show also the image of the product added?

Thank you in advance
Title: Re: Adding stuff in ajax popup
Post by: GJC Web Design on October 02, 2014, 22:26:12 PM
you ever answered the question

is this true?  if(!empty($prow->image))

echo out $prow->image
Title: Re: Adding stuff in ajax popup
Post by: pm4698 on October 02, 2014, 22:37:58 PM
Sorry but i don't know if this is true. I just saw this piece of code and i added it to my code like my previous post.

My problem is that i see no image at all. I don't know if its syntax error or something else
Title: Re: Adding stuff in ajax popup
Post by: pm4698 on October 09, 2014, 15:28:11 PM
I added inside padded.php file this line before h4 tag and it worked:

echo '<div style="text-align:center"><img src="'.JURI::base() . $prow->images[0]->file_url_thumb.'" alt="'.$prow->product_name.'" /></div>';