News:

Support the VirtueMart project and become a member

Main Menu

Ajax Mini Cart Product Image Problem

Started by weigruf, June 13, 2012, 13:34:21 PM

Previous topic - Next topic

weigruf

Hello!

I have succesfully edited some php files to show he product image thumbnail in the mini cart. I did that by adding the following code to:

my_template/helpers/cart.php in function prepareAjaxData():


                        if(!empty($product->image)) {
$this->data->products[$i]['image'] = JHTML::link($url, $product->image->displayMediaThumb('',false), 'title="'.$product->product_name.'"');
} else {
$this->data->products[$i]['image'] = '';
}


and...in my_template/mod_virtuemart_cart/default.php inside the foreach ($data->products as $product) loop:

<?php if ($product['image'] != '') { echo $product['image']; }?>

to actually display the  proudct image. The image is displayed right for every product but when I try to login as a user I am getting the following error in my_shop_url/component/users/?view=login page:

Fatal error: VirtueMartCart::prepareAjaxData() [<a href='virtuemartcart.prepareajaxdata'>virtuemartcart.prepareajaxdata</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;VmImage&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /blah...blah.../components/com_virtuemart/helpers/cart.php on line 1444

Thanks in advance!

weigruf

Fixed the error. :) Please lock the thread.

p.barg