Skip to content

Commit

Permalink
2.2.10 - order serialize should handle deleted products in order items
Browse files Browse the repository at this point in the history
  • Loading branch information
bnayalivne committed Nov 10, 2017
1 parent 15fb650 commit 5470c09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Model/Api/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ public function setConfig($mage_store_id, $configName, $scope, $newValue)
*/
public function getVersion()
{
return '2.2.9';
return '2.2.10';
}

/**
Expand Down
7 changes: 4 additions & 3 deletions Serializer/OrderSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lib-libxml": "*"
},
"type": "magento2-module",
"version": "2.2.9",
"version": "2.2.10",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Remarkety_Mgconnector" setup_version="2.2.9">
<module name="Remarkety_Mgconnector" setup_version="2.2.10">
</module>
</config>

0 comments on commit 5470c09

Please sign in to comment.