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:
2025-06-04 23:11:30 +02:00
parent 56aa2cdc2d
commit edcf46bab4
4 changed files with 14 additions and 7 deletions

View File

@@ -98,7 +98,7 @@
},
"google-merchant_id-1.xml": {
"type": "-",
"size": 18429810,
"size": 18470225,
"lmtime": 0,
"modified": true
},

View File

@@ -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' ] );
}

View File

@@ -83,6 +83,7 @@ class OrderFulfiller
// add cart
$cart = $this->cartProvider->provide($data);
$order->setCart($cart);
// add order lines

View File

@@ -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;
}
}