[email protected] Posted August 25, 2015 Share Posted August 25, 2015 Hello, When i update "social sharing" module product comparison page display blank. if i disable "social sharing" module then product comparison working fine. Link to comment Share on other sites More sharing options...
gabdara Posted August 25, 2015 Share Posted August 25, 2015 Enable development mode to see if there are any PHP errors. Link to comment Share on other sites More sharing options...
mastek Posted August 26, 2015 Share Posted August 26, 2015 hi, i have the same problem: On debug mode: Fatal error: Call to undefined method CompareController::getProduct() in /sklep1/modules/socialsharing/socialsharing.php on line 161 public function hookDisplayHeader($params) { if (!isset($this->context->controller->php_self) || !in_array($this->context->controller->php_self, array('product', 'products-comparison'))) return; $this->context->controller->addCss($this->_path.'css/socialsharing.css'); $this->context->controller->addJS($this->_path.'js/socialsharing.js'); $product = $this->context->controller->getProduct(); if (!Validate::isLoadedObject($product)) { return; } if (!$this->isCached('socialsharing_header.tpl', $this->getCacheId('socialsharing_header|'.(isset($product->id) && $product->id ? (int)$product->id : '')))) { $this->context->smarty->assign(array( 'price' => Tools::ps_round($product->getPrice(!Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer), null), _PS_PRICE_COMPUTE_PRECISION_), 'pretax_price' => Tools::ps_round($product->getPrice(false, null), _PS_PRICE_COMPUTE_PRECISION_), 'weight' => $product->weight, 'weight_unit' => Configuration::get('PS_WEIGHT_UNIT'), 'cover' => isset($product->id) ? Product::getCover((int)$product->id) : '', 'link_rewrite' => isset($product->link_rewrite) && $product->link_rewrite ? $product->link_rewrite : '', )); } return $this->display(__FILE__, 'socialsharing_header.tpl', $this->getCacheId('socialsharing_header|'.(isset($product->id) && $product->id ? (int)$product->id : ''))); } Link to comment Share on other sites More sharing options...
bside2234 Posted August 26, 2015 Share Posted August 26, 2015 Same here: Strict Standards: Declaration of Dispatcher::loadRoutes() should be compatible with that of DispatcherCore::loadRoutes() in /home/www/griffineffects.com/store/classes/PrestaShopAutoload.php on line 121Fatal error: Call to undefined method CompareController::getProduct() in /home/www/griffineffects.com/store/modules/socialsharing/socialsharing.php on line 161 Link to comment Share on other sites More sharing options...
gabdara Posted August 30, 2015 Share Posted August 30, 2015 I've submited a ticket for this issue: http://forge.prestashop.com/browse/PSCSX-6681 . Hope it will be solved soon. Link to comment Share on other sites More sharing options...
Lucardo Posted August 31, 2015 Share Posted August 31, 2015 FYI: For now, commenting the code works https://www.prestashop.com/forums/topic/395977-products-compare-error/?p=2134292 Link to comment Share on other sites More sharing options...
gabriiel Posted September 2, 2015 Share Posted September 2, 2015 Same problem here as well. Just commented that one line where the problem lies and it works again. Link to comment Share on other sites More sharing options...
ItalianBoutiqueShoes Posted September 2, 2015 Share Posted September 2, 2015 Same problem here too Link to comment Share on other sites More sharing options...
Elicode Posted September 3, 2015 Share Posted September 3, 2015 Same error message too on this new 1.6.6.1 with social sharing module 1.4.0 (on the prestashop 1.6.1.0 it was social sharing 1.3.0 I think, have to check) On modules/socialsharing/socialsharing.php I changed lines 161 to 165 with part of code of the social sharing v 1.3.0 and now it seems to work for me while waiting the new version. I have changed these lines (161 to 165) $product = $this->context->controller->getProduct(); if (!Validate::isLoadedObject($product)) { return; } to that : if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'product') return; $product = $this->context->controller->getProduct(); Or if you dont want to modify code, I confirm too that if the "social sharing" module is off, comparison is working back without any code modification. hope that it will help someone with that bug while waiting new version of social sharing module. Someone else could confirm to me if it works too for his new presta 1.6.1.1 ? Elicode 2 Link to comment Share on other sites More sharing options...
dsolsona Posted September 4, 2015 Share Posted September 4, 2015 (edited) Same error message too on this new 1.6.6.1 with social sharing module 1.4.0 (on the prestashop 1.6.1.0 it was social sharing 1.3.0 I think, have to check) On modules/socialsharing/socialsharing.php I changed lines 161 to 165 with part of code of the social sharing v 1.3.0 and now it seems to work for me while waiting the new version. I have changed these lines (161 to 165) to that : Or if you dont want to modify code, I confirm too that if the "social sharing" module is off, comparison is working back without any code modification. hope that it will help someone with that bug while waiting new version of social sharing module. Someone else could confirm to me if it works too for his new presta 1.6.1.1 ? Elicode Thanks! your code works perfect! prestashop 1.6.1.1 David Edited September 4, 2015 by dsolsona (see edit history) Link to comment Share on other sites More sharing options...
creatile Posted September 4, 2015 Share Posted September 4, 2015 This works for me as well on 1.6.1.1 Link to comment Share on other sites More sharing options...
rubensaid Posted September 18, 2015 Share Posted September 18, 2015 (edited) I'm using this code. Is almost the same, but just I'm making sure that code will not call to getProduct() function when CompareController is the context. However, js and css will load on both pages public function hookDisplayHeader($params) { if (!isset($this->context->controller->php_self) || !in_array($this->context->controller->php_self, array('product', 'products-comparison'))) return; $this->context->controller->addCss($this->_path.'css/socialsharing.css'); $this->context->controller->addJS($this->_path.'js/socialsharing.js'); if(in_array($this->context->controller->php_self, array('product'))) $product = $this->context->controller->getProduct(); if (!Validate::isLoadedObject($product)) { return; } Edited September 18, 2015 by comprope (see edit history) 1 Link to comment Share on other sites More sharing options...
flexbueno Posted September 25, 2015 Share Posted September 25, 2015 Same error message too on this new 1.6.6.1 with social sharing module 1.4.0 (on the prestashop 1.6.1.0 it was social sharing 1.3.0 I think, have to check) On modules/socialsharing/socialsharing.php I changed lines 161 to 165 with part of code of the social sharing v 1.3.0 and now it seems to work for me while waiting the new version. I have changed these lines (161 to 165) to that : Or if you dont want to modify code, I confirm too that if the "social sharing" module is off, comparison is working back without any code modification. hope that it will help someone with that bug while waiting new version of social sharing module. Someone else could confirm to me if it works too for his new presta 1.6.1.1 ? Elicode Works like a charm bro, thanks!! Link to comment Share on other sites More sharing options...
adeeltalib Posted October 5, 2015 Share Posted October 5, 2015 I was having the same error but when I went to backoffice >> Modules and Services >> Social sharing, it showed that an update is available. I update it and it is now working like a charm. I am using v1.6.1.1. Ad Link to comment Share on other sites More sharing options...
Recommended Posts