Product Image on Virtuemart Cart Page
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





joomlaservices
joomlaservices
394295112
joomlaservices
+91-9853790816
joomlaservices

Comments
thanks
what can i do to see origignal size image?
under which lines of code do these both need to be under
Much obliged.
http://forum.virtuemart.net/index.php?topic=65827.0
what can i do to see origignal size image?
Great post! It's very useful for me.
'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