update
This commit is contained in:
@@ -163,7 +163,6 @@
|
||||
|
||||
<? if ( \Shared\Helpers\Helpers::get_session('google-analytics-purchase') ):?>
|
||||
<? if ( $this -> settings['google_tag_manager_id'] ):?>
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
event: "purchase",
|
||||
ecommerce: {
|
||||
@@ -175,9 +174,9 @@
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
{
|
||||
item_id: "<?= $product['product_id'];?>",
|
||||
item_name: "<?= str_replace( '"', '', $product['name'] );?>",
|
||||
item_name: '<?= $product['name'];?>',
|
||||
quantity: <?= (int)$product['quantity'];?>,
|
||||
price: <?= ((float)$product['price_brutto_promo'] > 0 && (float)$product['price_brutto_promo'] < (float)$product['price_brutto']) ? \Shared\Helpers\Helpers::normalize_decimal( $product['price_brutto_promo'] ) : \Shared\Helpers\Helpers::normalize_decimal( $product['price_brutto'] );?>,
|
||||
price: <?= (float)$product['price_brutto_promo'] > 0 ? \Shared\Helpers\Helpers::normalize_decimal( $product['price_brutto_promo'] ) : \Shared\Helpers\Helpers::normalize_decimal( $product['price_brutto'] );?>,
|
||||
google_business_vertical: 'retail'
|
||||
}<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
|
||||
<? endforeach;?>
|
||||
@@ -195,7 +194,7 @@
|
||||
}
|
||||
});
|
||||
<? endif;?>
|
||||
<? unset( $_SESSION['google-analytics-purchase'] );?>
|
||||
<? unset( $_SESSION['google-adwords-purchase'] );?>
|
||||
<? endif;?>
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
Reference in New Issue
Block a user