Jump to content

Product compare not working


Recommended Posts

Hi

 

I have upgraded to the latest prestashop after using v1.6.0.9 without a problem.

 

I have just dicoverd that my compare items does not work at all anymore.  It goes to a blank page in google chrome.  I tried in ie and it says a 500 error.

 

I then disabled to compare by placing zero in products and the feature is no longer available for now until it gets fixed.

 

Any help please

Link to comment
Share on other sites

internal server error 500 = errors

in this case it will be necessary to inspect website with enabled error reporting

in simple words:

open: config/defines.inc.php

find this line: define('_PS_MODE_DEV_', false);

change to look like this: define('_PS_MODE_DEV_', true);

 

 

then instead of blank page you will see detailed information what's up there. please share it.

Link to comment
Share on other sites

The complete error is:
Fatal error: Cannot use object of type Product as array in /modules/ganalytics/ganalytics.php on line 379

 

Line 379 is the if (!isset($product['price'])) of the wrapProducts() function.

Complete code:

	/**
	* wrap products to provide a standard products information for google analytics script
	*/
	public function wrapProducts($products, $extras = array(), $full = false)
	{
		$result_products = array();
		if (!is_array($products))
			return;

		$currency = new Currency($this->context->currency->id);
		$usetax = (Product::getTaxCalculationMethod((int)$this->context->customer->id) != PS_TAX_EXC);
		foreach ($products as $index => $product)
		{
			if (!isset($product['price']))
				$product['price'] = (float)Tools::displayPrice(Product::getPriceStatic((int)$product['id_product'], $usetax), $currency);
			$result_products[] = $this->wrapProduct($product, $extras, $index, $full);
		}

		return $result_products;
	} 

So I guess there is an issue with the Prestashop Google Analytics module combined with this feature.

Link to comment
Share on other sites

In my 1.6.11 version and with the most recent update to Google Analytics and that does not resolve complaint made by OP "my compare items does not work at all anymore.  It goes to a blank page"  Disabling Google Analytics does allow compare to work. 

Link to comment
Share on other sites

There was an upgrade to the compare module today.  I installed the update and now the compare feature works.  I had a feeling in my case it had something to do with the Google analytics module because it was the only module i added when the compare feature stopped working.  The upgrade has seemed to fix the issue

Link to comment
Share on other sites

  • 3 weeks later...

There was an upgrade to the compare module today.  I installed the update and now the compare feature works.  I had a feeling in my case it had something to do with the Google analytics module because it was the only module i added when the compare feature stopped working.  The upgrade has seemed to fix the issue

 

Hi Famoso,

 

I have the same problem with compare product.

 

May I know what have you been upgrading and how do you upgrade?

 

Hope you can share, thank you!

Link to comment
Share on other sites

  • 4 weeks later...

internal server error 500 = errors

in this case it will be necessary to inspect website with enabled error reporting

in simple words:

open: config/defines.inc.php

find this line: define('_PS_MODE_DEV_', false);

change to look like this: define('_PS_MODE_DEV_', true);

 

 

then instead of blank page you will see detailed information what's up there. please share it.

 

Hi Vekia,

 

I am having same issue. My product comparison works in IE, Mozilla firefox and safari but does not work in chrome. I cam unable to locate the source of the problem.

I use 1.6 version of prestashop and I dont use default theme.

Any help is appreciated.

Thanks.

 

Regards,

Prerana

Link to comment
Share on other sites

  • 5 months later...

I use prestashop 1.6.1.1 with theme technoshop (http://addons.prestashop.com/en/high-tech-themes/186[spam-filter]technoshop-responsive.html) and I've uninstalled analytics module. Compare products return White screen :(

 

minutes later: In my case, the problem was socialsharing module. I've activated the php error messages to see it.

 

recargs,

David

Edited by dsolsona (see edit history)
Link to comment
Share on other sites

  • 4 months later...
Hi Vekia, I debugging enabled. Here is the error that pops out:
Fatal error: Call to undefined method CompareController :: getProduct () in ... / modules / socialsharing / socialsharing.php on line 161
 
I updated the Social Sharing module and the error has disappeared. Now it works as usual.
 
Thank you
 
My version of PrestaShop is 1.6.0.14
 

internal server error 500 = errors

in this case it will be necessary to inspect website with enabled error reporting

in simple words:

open: config/defines.inc.php

find this line: define('_PS_MODE_DEV_', false);

change to look like this: define('_PS_MODE_DEV_', true);

 

 

then instead of blank page you will see detailed information what's up there. please share it.

 

 

 
Link to comment
Share on other sites

  • 1 year later...

Regarding this, i had the same problem and solve it on admin->performance tab-> smarty by selecting second option (compile...) if it is set to force compile it will not show the product comparison page.

 

I have PS 1.6.0.6 version

Best Regards

Cadmiel

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...