exponea / bloomreach-magento2-integration

MIT License
1 stars 5 forks source link

Throws an error, if $orderItem->getSku() returns null #46

Open pip77 opened 5 months ago

pip77 commented 5 months ago

https://github.com/exponea/bloomreach-magento2-integration/blob/e4cf0f2f7b19c8c487379288a189eaea2ff100e1/Model/DataMapping/FieldValueRenderer/Order/ProductList.php#L62

quick fix: return $product ? $product->getSku() : ($orderItem->getSku() ?? "");

eduard13 commented 5 months ago

Hi @pip77, that's really weird that the sku doesn't exist for your order item. However, since the DB column can be null, then we'll have this fixed within next releases.

Thank you for reporting this one.