Skip to content

Commit

Permalink
Set v1.1.0. Added acl.xml. Added resources for Connector. Added shipp…
Browse files Browse the repository at this point in the history
…ing_address
  • Loading branch information
Returnless committed Jun 10, 2021
1 parent 3cec423 commit 8730806
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Model/Api/OrderInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ public function getOrderInfoReturnless($incrementId)
$orderInfo['customer']['phone'] = $billingAddress->getTelephone();
}

$shippingAddress = $order->getShippingAddress();
if ($shippingAddress) {
$orderInfo['shipping_address']['first_name'] = $shippingAddress->getFirstname();
$orderInfo['shipping_address']['last_name'] = $shippingAddress->getLastname();
$orderInfo['shipping_address']['postcode'] = $shippingAddress->getPostcode();
$orderInfo['shipping_address']['city'] = $shippingAddress->getCity();
$street1 = $shippingAddress->getStreet();
$orderInfo['shipping_address']['country']['code2'] = $shippingAddress->getCountryId();
$orderInfo['shipping_address']['address1'] = isset($street1[0]) ? $street1[0] : '';
$orderInfo['shipping_address']['address2'] = isset($street1[1]) ? $street1[1] : '';
$orderInfo['shipping_address']['addition'] = isset($street1[2]) ? $street1[2] : '';
$orderInfo['customer']['phone'] = $shippingAddress->getTelephone();
}

$separateBundle = $this->config->getSeparateBundle();
$orderItems = $separateBundle ? $order->getAllItems() : $order->getAllVisibleItems();

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"OSL-3.0",
"AFL-3.0"
],
"version": "1.0.9"
"version": "1.1.0"
}
13 changes: 13 additions & 0 deletions etc/acl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Returnless_ReturnWebhook::config" title="Returnless">
<resource id="Returnless_Connector::returnless_connector_config" title="Connector Api" sortOrder="20" />
</resource>
</resource>
</resources>
</acl>
</config>
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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="Returnless_Connector" setup_version="1.0.9">
<module name="Returnless_Connector" setup_version="1.1.0">
<sequence>
<module name="Magento_Sales"/>
</sequence>
Expand Down

0 comments on commit 8730806

Please sign in to comment.