Zaktualizowano rozmiar pliku google-merchant_id-1.xml oraz dodano logikę aktualizacji źródła zamówienia dla zamówień Empik w klasie OrderFulfiller.
This commit is contained in:
2
.vscode/ftp-kr.sync.cache.json
vendored
2
.vscode/ftp-kr.sync.cache.json
vendored
@@ -98,7 +98,7 @@
|
||||
},
|
||||
"google-merchant_id-1.xml": {
|
||||
"type": "-",
|
||||
"size": 18429810,
|
||||
"size": 18470225,
|
||||
"lmtime": 0,
|
||||
"modified": true
|
||||
},
|
||||
|
||||
@@ -22,6 +22,12 @@ if ( $erli_date )
|
||||
echo '<p>Zamówienie erli ID: ' . $order['id_order'] . '</p>';
|
||||
}
|
||||
|
||||
if ( is_array( $statuses ) and count( array_intersect( $statuses, [ '45' ] ) ) > 0 )
|
||||
{
|
||||
$mdb -> update( 'ps_orders', [ 'order_source' => 'Empik' ], [ 'id_order' => $order['id_order'] ] );
|
||||
echo '<p>Zamówienie empik ID: ' . $order['id_order'] . '</p>';
|
||||
}
|
||||
|
||||
$erli_date = $order['date_add'];
|
||||
$mdb -> update( 'custom_cron', [ 'value' => $erli_date ], [ 'param' => 'erli_orders_check' ] );
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ class OrderFulfiller
|
||||
|
||||
// add cart
|
||||
$cart = $this->cartProvider->provide($data);
|
||||
|
||||
$order->setCart($cart);
|
||||
|
||||
// add order lines
|
||||
|
||||
@@ -18,7 +18,7 @@ class OrderProcessor
|
||||
{
|
||||
const CODE_WAITING_ACCEPTANCE = 'WAITING_ACCEPTANCE';
|
||||
const CODE_SHIPPING = 'SHIPPING';
|
||||
|
||||
|
||||
/** @var EmpikClientFactory */
|
||||
protected $empikClientFactory;
|
||||
|
||||
@@ -59,7 +59,7 @@ class OrderProcessor
|
||||
if (!$this->allowAccept && !$this->allowImport) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$response = $this->empikClient->getOrders([
|
||||
'order_state_codes' => implode(',', $this->getOrderCodesForProcess()),
|
||||
]);
|
||||
@@ -111,19 +111,19 @@ class OrderProcessor
|
||||
$this->logger->logError(sprintf('Error accepting order [%s]', $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function getOrderCodesForProcess()
|
||||
{
|
||||
$codes = [];
|
||||
|
||||
|
||||
if ($this->allowAccept) {
|
||||
$codes[] = self::CODE_WAITING_ACCEPTANCE;
|
||||
}
|
||||
|
||||
|
||||
if ($this->allowImport) {
|
||||
$codes[] = self::CODE_SHIPPING;
|
||||
}
|
||||
|
||||
|
||||
return $codes;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user