Syntaxfehler im PHP-Code finden
bearbeitet von Jörg ReinholzMoin!
Warum nicht einfach:
~~~php
<?php
$items['transactionId'] = "12345";
$items['transctionTotal'] = "46,30 Euro";
$items[0][product_ean] = "1";
$items[0][product_name] = "Produkt 1";
$items[0][category] = "Kategorie 1";
$items[0][product_item_price] = "10,00 Euro";
$items[0][product_quantity] = "1";
#...
?>
<script>
dataLayer = [<?php echo json_encode($items); ?>]
</script>
~~~
???
Jörg Reinholz
Syntaxfehler im PHP-Code finden
bearbeitet von Jörg ReinholzMoin!
Warum nicht einfach:
~~~php
<?php
$items['transactionId'] = "12345";
$items['transctionTotal'] = "46,30 Euro";
$items[0][product_ean] = "1";
$items[0][product_name] = "Produkt 1";
$items[0][category] = "Kategorie 1";
$items[0][product_item_price] = "10,00 Euro";
$items[0][product_quantity] = "1";
#...
?>
<script>
dataLayer = '<?php echo json_encode($items); ?>'
</script>
~~~
???
Jörg Reinholz
Syntaxfehler im PHP-Code finden
bearbeitet von Jörg ReinholzMoin!
Warum nicht einfach:
~~~php
<?php
$items['transactionId'] = "12345";
$items['$transctionTotal'] = "46,30 Euro";
$items[0][product_ean] = "1";
$items[0][product_name] = "Produkt 1";
$items[0][category] = "Kategorie 1";
$items[0][product_item_price] = "10,00 Euro";
$items[0][product_quantity] = "1";
#...
?>
<script>
dataLayer = '<?php echo json_encode($items); ?>'
</script>
~~~
???
Jörg Reinholz
Syntaxfehler im PHP-Code finden
bearbeitet von Jörg ReinholzMoin!
Warum nicht einfach:
~~~php
...
<script>
dataLayer = '<?php echo json_encode($items); ?>'
</script>
~~~
???
Jörg Reinholz