Slogan LiveZilla Live Help

Product Image on Virtuemart Cart Page

Edit 4 files to show product thumbnails in shopping cart and the checkout process:

1. basket_b2c.html.php
2. ro_basket_b2c.html.php
3. basket.php
4. ro_basket.php

Files 1 & 2 are in:  /components/com_virtuemart/theme/templates/basket
Files 3 & 4 are in: /administrator/components/com_virtuemart/html

basket_b2c.html.php and ro_basket_b2c.html.php are themplates files used to display the chart.

At about line 32, add the following code to the 2 theme files:

Code:

<td><?php echo $product['product_thumb_image'] ?></td>


Then you have to add code to create the field 'product_thumb_image' in the product records.  To do that you must edit basket.php and ro_basket.php and add this code at line 90:

Code:

//prepare thumb image

if( $ps_product->get_field($_SESSION['cart'][$i]["product_id"], "product_thumb_image") ) {
$product_thumb_image = $ps_product->get_field($_SESSION['cart'][$i]["product_id"], "product_thumb_image");
}
else {
$product_thumb_image = 0;
}

if( $product_thumb_image ) {
if( substr( $product_thumb_image, 0, 4) != "http" ) {
if(PSHOP_IMG_RESIZE_ENABLE == '1') {
$product_thumb_image = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($product_thumb_image)."&newxsize=".PSHOP_IMG_WIDTH."&newysize=".PSHOP_IMG_HEIGHT."&fileout=";
}
else {
if( file_exists( IMAGEPATH."product/".$product_thumb_image )) {
$product_thumb_image = IMAGEURL."product/".$product_thumb_image;
}
else {
$product_thumb_image = IMAGEURL.NO_IMAGE;
}
}
}
}
else {
$product_thumb_image = IMAGEURL.NO_IMAGE;
}

$product_rows[$i]['product_thumb_image'] = "<a href=\"$url\">"
. "<img width=100 src= $product_thumb_image />"
. "</a><br />";
//end of prepare thumb image

Comments

avatar Gradwell
0
 
 
FIxd this with in 2 secs with your tutorial..
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar solar
0
 
 
great tutorial.
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar ChanCALLIE35
0
 
 
This is what I was looking for a while! Thank you for this topic just about school! Once somebody state that In union there is might. Our powerfully trained team can help you in writing custom essays.
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar proud.joomla.user
0
 
 
tried to add the code to line 90 and it did not work, under what LINE of code (please post actual code) do i need to enter the code.

thanks
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar LeopardDriver
0
 
 
What VM version you are using dude ? It works superb and perfect on point!
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar Dimas
0
 
 
it is work.. thank you very much!!
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar ghj
0
 
 
it works
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar Ali
0
 
 
Works great Thanks
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar YRG
0
 
 
Didn't know about this. I will have to try it out.
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar Aamir
0
 
 
gr8 nice
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
It works.. thank you!!
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar Zidni Mubarock
0
 
 
How if add image product on cart module, help me please... :)
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar zibideusz
0
 
 
it this tutorial when you click in thumb you are going to product page.
what can i do to see origignal size image?
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar Admin
0
 
 
No, but that can be done.
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
This is a treat tutorial :)
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar john
0
 
 
some line numbers don't match up.....
under which lines of code do these both need to be under
Much obliged.
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar john
0
 
 
does anyone have this hack for VM 1.1.4?
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar john
0
 
 
MCallf, thanks for this solution:
http://forum.virtuemart.net/index.php?topic=65827.0

Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar tiffany
0
 
 
it this tutorial when you click in thumb you are going to product page.
what can i do to see origignal size image?
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar sky lanterns
0
 
 
I agree with your thought.Thank you for your sharing.
Great post! It's very useful for me.
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar macaulus
0
 
 
great, works sweet, i did have to add a line to the english.php
'PHPSHOP_CART_IMAGE' => 'Image',
in administrator/components/com_virtuemart/languages/common/english.php
and also add a new to the
basket_b2c.html.php and ro_basket_b2c.html.php to include the heading above the image
_('PHPSHOP_CART_IMAGE') ?>
Worked sweet though, thanks for the hack
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar macaulus
0
 
 
seems that some of the above got stripped out, pretty sure you can see what i mean though when you look at the files, just needs the th in there
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
button_logo_portfolio
button_quote
button_testimonials

Subscribe Tutorials

Enter your email address:

Paypal Donation

Enter Amount:

Subscribe Joomla Tutorials Newsletter

Name:

Email:


Enter your email address: