Skip to content

Commit

Permalink
Merge pull request #14 from Quetzacoalt91/fix-notice-ps-1.7.5
Browse files Browse the repository at this point in the history
Only cast as array when a product is returned
  • Loading branch information
Pablo Borowicz committed Oct 1, 2018
2 parents beb97fd + af63d5b commit dd7c119
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ps_googleanalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,11 @@ public function hookdisplayFooterProduct($params)
$controller_name = Tools::getValue('controller');
if ($controller_name == 'product')
{
if ($params['product'] instanceof Product) {
$params['product'] = (array) $params['product'];
}
// Add product view
$ga_product = $this->wrapProduct((array)$params['product'], null, 0, true);
$ga_product = $this->wrapProduct($params['product'], null, 0, true);
$js = 'MBG.addProductDetailView('.json_encode($ga_product).');';

if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) > 0) {
Expand Down

0 comments on commit dd7c119

Please sign in to comment.