News:

Support the VirtueMart project and become a member

Main Menu

[solved] Adding stuff in ajax popup

Started by pm4698, September 04, 2014, 11:06:54 AM

Previous topic - Next topic

pm4698

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!

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

pm4698

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?

pm4698

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>
                            <? }
}



}
}

GJC Web Design

and is this true?  if(!empty($prow->image))
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pm4698

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

GJC Web Design

you ever answered the question

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

echo out $prow->image
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pm4698

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

pm4698

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>';