Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Google/GlobalSiteTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public function maybe_display_conversion_and_purchase_event_snippets( string $ad
// Get the item info in the order
$item_info = [];
foreach ( $order->get_items() as $item_id => $item ) {
$product_id = $item->get_product_id();
$product_id = $item->get_variation_id() ?: $item->get_product_id();
$product_name = $item->get_name();
$quantity = $item->get_quantity();
$price = $order->get_item_total( $item );
Expand Down Expand Up @@ -505,7 +505,7 @@ private function display_page_view_event_snippet(): void {

foreach ( WC()->cart->get_cart() as $cart_item ) {
// gets the product id
$id = $cart_item['product_id'];
$id = ! empty( $cart_item['variation_id'] ) ? $cart_item['variation_id'] : $cart_item['product_id'];

// gets the product object
$product = $cart_item['data'];
Expand Down
Loading