diff --git a/Model/Api/Data.php b/Model/Api/Data.php index a4b23bd..fd5022d 100644 --- a/Model/Api/Data.php +++ b/Model/Api/Data.php @@ -1206,7 +1206,7 @@ public function setConfig($mage_store_id, $configName, $scope, $newValue) */ public function getVersion() { - return '2.2.9'; + return '2.2.10'; } /** diff --git a/Serializer/OrderSerializer.php b/Serializer/OrderSerializer.php index 6312c8e..232bcaa 100644 --- a/Serializer/OrderSerializer.php +++ b/Serializer/OrderSerializer.php @@ -42,6 +42,7 @@ public function serialize(\Magento\Sales\Model\Order $order){ $items = $order->getAllVisibleItems(); $line_items = []; foreach($items as $item){ + $product = $item->getProduct(); $itemArr = [ //'product_parent_id' => $rmCore->getProductParentId($item->getProduct()), 'product_id' => $item->getProductId(), @@ -50,10 +51,10 @@ public function serialize(\Magento\Sales\Model\Order $order){ 'quantity_refunded' => $item->getQtyRefunded(), 'quantity_shipped' => $item->getQtyShipped(), 'name' => $item->getName(), - 'title' => $item->getProduct()->getName(), + 'title' => empty($product) ? $item->getName() : $product->getName(), 'price' => (float)$item->getPrice(), - 'url' => $item->getProduct()->getProductUrl(), - 'images' => $this->remarketyHelper->getMediaGalleryImages($item->getProduct()) + 'url' => empty($product) ? null : $product->getProductUrl(), + 'images' => empty($product) ? [] : $this->remarketyHelper->getMediaGalleryImages($product) ]; $line_items[] = $itemArr; diff --git a/composer.json b/composer.json index f5a9a6a..2d41585 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "2.2.9", + "version": "2.2.10", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/etc/module.xml b/etc/module.xml index c495534..af7a945 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,5 +1,5 @@ - +