Skip to content

Commit 8677978

Browse files
swinard-metaSean Winard
andauthored
Remove support for different shipment events and only support 'auto' sync (#624)
Co-authored-by: Sean Winard <[email protected]>
1 parent 0a9c00e commit 8677978

File tree

4 files changed

+4
-46
lines changed

4 files changed

+4
-46
lines changed

app/code/Meta/BusinessExtension/Model/System/Config.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class Config
8989
public const XML_PATH_FACEBOOK_ORDERS_SYNC_ACTIVE = 'facebook/orders_sync/active';
9090
public const XML_PATH_FACEBOOK_ORDERS_SYNC_DEFAULT_ORDER_STATUS = 'facebook/orders_sync/default_order_status';
9191
public const XML_PATH_FACEBOOK_AUTO_SUBSCRIBE_TO_NEWSLETTER = 'facebook/orders_sync/auto_subscribe_to_newsletter';
92-
private const XML_PATH_FACEBOOK_ORDER_SHIP_EVENT = 'facebook/orders_sync/order_ship_event';
93-
9492
private const XML_PATH_FACEBOOK_USE_DEFAULT_FULFILLMENT_LOCATION =
9593
'facebook/orders_sync/default_fulfillment_location';
9694
private const XML_PATH_FACEBOOK_FULFILLMENT_LOCATION_STREET_LINE_1 = 'facebook/orders_sync/street_line1';
@@ -494,19 +492,6 @@ public function isAutoNewsletterSubscriptionOn($scopeId = null, $scope = null):
494492
return (bool)$this->getConfig(self::XML_PATH_FACEBOOK_AUTO_SUBSCRIBE_TO_NEWSLETTER, $scopeId, $scope);
495493
}
496494

497-
/**
498-
* Get order ship event
499-
*
500-
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
501-
* @param int|null $scopeId
502-
* @param int $scope
503-
* @return string
504-
*/
505-
public function getOrderShipEvent($scopeId = null, $scope = null)
506-
{
507-
return $this->getConfig(self::XML_PATH_FACEBOOK_ORDER_SHIP_EVENT, $scopeId, $scope);
508-
}
509-
510495
/**
511496
* Get config
512497
*

app/code/Meta/Sales/Model/Order/Shipper.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,6 @@ public function __construct(
9595
$this->facebookOrder = $facebookOrder;
9696
}
9797

98-
/**
99-
* Get order ship event
100-
*
101-
* @param int|null $storeId
102-
* @return null|string
103-
*/
104-
public function getOrderShipEvent($storeId = null)
105-
{
106-
return $this->systemConfig->getOrderShipEvent($storeId);
107-
}
108-
10998
/**
11099
* Mark order items as shipped
111100
*

app/code/Meta/Sales/Observer/Order/ShipmentObserver.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,17 @@
2626
use Magento\Framework\Event\ObserverInterface;
2727
use Magento\Framework\Exception\LocalizedException;
2828
use Magento\Sales\Model\Order\Shipment;
29-
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
3029
use Meta\BusinessExtension\Helper\FBEHelper;
30+
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
3131
use Meta\Sales\Helper\OrderHelper;
3232
use Meta\Sales\Model\Order\Shipper;
33-
use Psr\Log\LoggerInterface;
34-
3533
use Meta\Sales\Observer\MetaObserverTrait;
34+
use Psr\Log\LoggerInterface;
3635

3736
class ShipmentObserver implements ObserverInterface
3837
{
3938
use MetaObserverTrait;
40-
39+
4140
/**
4241
* @var SystemConfig
4342
*/
@@ -154,12 +153,7 @@ protected function executeImpl(Observer $observer)
154153
return;
155154
}
156155

157-
$orderShipmentEvent = $this->shipper->getOrderShipEvent($storeId);
158-
if ($observer->getEvent()->getName() === $orderShipmentEvent) {
159-
$this->executeMarkAsShipped($shipment);
160-
} elseif (Shipper::MAGENTO_EVENT_SHIPMENT_AUTO === $orderShipmentEvent) {
161-
$this->executeAutoSync($shipment);
162-
}
156+
$this->executeAutoSync($shipment);
163157
}
164158

165159
/**

app/code/Meta/Sales/etc/config.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
<default_order_status>pending</default_order_status>
99
<auto_subscribe_to_newsletter>1</auto_subscribe_to_newsletter>
1010
<default_fulfillment_location>1</default_fulfillment_location>
11-
<!--
12-
The event on which to trigger shipment sync, based on particular fulfillment flow.
13-
Alternatively, use 'auto' to allow Meta to determine the best strategy.
14-
15-
Supported values:
16-
auto
17-
sales_order_shipment_save_after
18-
sales_order_shipment_track_save_after
19-
-->
20-
<order_ship_event>auto</order_ship_event>
2111
</orders_sync>
2212
</facebook>
2313
<payment>

0 commit comments

Comments
 (0)