Skip to content

Commit 69bdf46

Browse files
authored
Merge pull request #9 from Faslet/fix/variant-order-tracking
Fix SKU retrieval logic for order items
2 parents 25018f6 + 184f81c commit 69bdf46

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ViewModel/OrderTracking.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private function getItemData(Order\Item $orderItem): array
136136
}
137137

138138
return [
139-
'sku' => $this->getAttributeValue($orderItem->getProduct(), 'sku'),
139+
'sku' => $variant ? $this->getAttributeValue($variant, 'sku') : $this->getAttributeValue($orderItem->getProduct(), 'sku'),
140140
'correlationId' => $this->getAttributeValue($orderItem->getProduct(), 'identifier'),
141141
'title' => $orderItem->getName(),
142142
'variant_id' => $variant ? $this->getAttributeValue($variant, 'identifier') : null,

0 commit comments

Comments
 (0)