Skip to content

Commit fcc9c59

Browse files
[MO] : Bug with serialize
1 parent bfcc7fd commit fcc9c59

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<module>
33
<name>ps_googleanalytics</name>
44
<displayName><![CDATA[Google Analytics]]></displayName>
5-
<version><![CDATA[3.0.0]]></version>
5+
<version><![CDATA[3.0.1]]></version>
66
<description><![CDATA[Gain clear insights into important metrics about your customers, using Google Analytics]]></description>
77
<author><![CDATA[PrestaShop]]></author>
88
<tab><![CDATA[analytics_stats]]></tab>

ps_googleanalytics.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public function __construct()
4040
{
4141
$this->name = 'ps_googleanalytics';
4242
$this->tab = 'analytics_stats';
43-
$this->version = '3.0.0';
44-
$this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_);
43+
$this->version = '3.0.1';
44+
$this->ps_versions_compliancy = array('min' => '1.7.0.0', 'max' => _PS_VERSION_);
4545
$this->author = 'PrestaShop';
4646
$this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8';
4747
$this->bootstrap = true;
@@ -320,7 +320,7 @@ public function hookdisplayFooter()
320320
if (isset($this->context->cookie->ga_cart)) {
321321
$this->filterable = 0;
322322

323-
$gacarts = unserialize($this->context->cookie->ga_cart);
323+
$gacarts = Tools::jsonDecode($this->context->cookie->ga_cart);
324324
foreach ($gacarts as $gacart) {
325325
if ($gacart['quantity'] > 0) {
326326
$ga_scripts .= 'MBG.addToCart('.Tools::jsonEncode($gacart).');';
@@ -771,7 +771,7 @@ public function hookactionCartSave()
771771
}
772772

773773
if (isset($this->context->cookie->ga_cart)) {
774-
$gacart = unserialize($this->context->cookie->ga_cart);
774+
$gacart = Tools::jsonDecode($this->context->cookie->ga_cart);
775775
} else {
776776
$gacart = array();
777777
}
@@ -791,7 +791,7 @@ public function hookactionCartSave()
791791
}
792792

793793
$gacart[$id_product] = $ga_products;
794-
$this->context->cookie->ga_cart = serialize($gacart);
794+
$this->context->cookie->ga_cart = Tools::jsonEncode($gacart);
795795
}
796796
}
797797

0 commit comments

Comments
 (0)