We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ef7cd10 + 95eac65 commit a87bbe1Copy full SHA for a87bbe1
1 file changed
classes/Hook/HookDisplayFooter.php
@@ -27,6 +27,8 @@
27
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler;
28
use PrestaShop\Module\Ps_Googleanalytics\Wrapper\ProductWrapper;
29
use Ps_Googleanalytics;
30
+use RecursiveArrayIterator;
31
+use RecursiveIteratorIterator;
32
use Tools;
33
34
class HookDisplayFooter implements HookInterface
@@ -70,6 +72,11 @@ public function run()
70
72
$gacart['quantity'] = abs($gacart['quantity']);
71
73
$gaScripts .= 'MBG.removeFromCart(' . json_encode($gacart) . ');';
74
}
75
+ } elseif (is_array($gacart)) {
76
+ $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($gacart));
77
+ foreach ($it as $v) {
78
+ $gaScripts .= $v;
79
+ }
80
} else {
81
$gaScripts .= $gacart;
82
0 commit comments