feat(02-purchase-event-prepayment): move purchase event to przelewy24 pre-payment page
Phase 2 complete: - buildPurchaseDataLayer() called in przelewy24() controller, payload passed to template - dataLayer.push added to templates/tickets/przelewy24.php (fires at order commitment) - dataLayer.push removed from templates/tickets/order-confirm.php - Captures 100% of orders regardless of user returning from payment gateway Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,21 +1,3 @@
|
||||
<?php
|
||||
$purchaseDataLayerJson = null;
|
||||
if (is_array($this->purchase_data_layer ?? null)) {
|
||||
$purchaseDataLayerJson = json_encode(
|
||||
$this->purchase_data_layer,
|
||||
JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_INVALID_UTF8_SUBSTITUTE
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if($purchaseDataLayerJson) : ?>
|
||||
<script type="text/javascript">
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.dataLayer.push({ ecommerce: null });
|
||||
window.dataLayer.push(<?= $purchaseDataLayerJson; ?>);
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($this->order_successful === true) : ?>
|
||||
<script type="text/javascript">
|
||||
$.alert({
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
<?php
|
||||
$purchaseDataLayerJson = null;
|
||||
if (is_array($this->purchase_data_layer ?? null)) {
|
||||
$purchaseDataLayerJson = json_encode(
|
||||
$this->purchase_data_layer,
|
||||
JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_INVALID_UTF8_SUBSTITUTE
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if($purchaseDataLayerJson) : ?>
|
||||
<script type="text/javascript">
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.dataLayer.push({ ecommerce: null });
|
||||
window.dataLayer.push(<?= $purchaseDataLayerJson; ?>);
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$clientData = $this->order;
|
||||
$merchant_id = $this->settings['p24']['merchant_id'];
|
||||
|
||||
Reference in New Issue
Block a user