Skip to content

Commit

Permalink
Add missing currency on view_item
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Mar 19, 2024
1 parent 567bb82 commit e03eaf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-1
* Added a debug log for debugging the 'purchase' event without make a purchase.
* Improved the pagespeed of the control panel. The control panel is now loading significantly faster than before.

#### Bugfixes:
* Add missing 'currency' on the 'view_item' event.

#### Other:
* Require WooCommerce 8.0.

Expand Down
5 changes: 3 additions & 2 deletions src/Integration/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@ public function get_datalayer_content_product_page( array $data_layer ): array {
$data_layer['productType'] = $product->get_type();
$data_layer['event'] = 'view_item';
$data_layer['ecommerce'] = [
'items' => [ $item ],
'value' => (float) $item['price'],
'items' => [ $item ],
'value' => (float) $item['price'],
'currency' => $this->store_currency,
];

return $data_layer;
Expand Down

0 comments on commit e03eaf2

Please sign in to comment.