Skip to content

Commit

Permalink
fix: remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois-Gomis authored and Benjamin-Freoua-Alma committed Aug 2, 2024
1 parent 10a282f commit 5e73e9d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions alma/controllers/hook/ActionObjectUpdateAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,25 @@ public function __construct($orderFactory, $clientHelper, $carrierFactory)
*/
public function run($params)
{
Logger::instance()->info('[Alma] - Start Run');
if (
!isset($params['object']) ||
!($params['object'] instanceof \OrderCarrierCore)
) {
return;
}
Logger::instance()->info('[Alma] - it s OrderCarrierCore object');

/** @var \OrderCarrier $orderCarrier */
$orderCarrier = $params['object'];
$idOrder = $orderCarrier->id_order;
Logger::instance()->info('[Alma] - id order ' . $idOrder);

/** @var \OrderCore $order */
try {
$order = $this->orderFactory->create($idOrder);
} catch (\PrestaShopException $e) {
Logger::instance()->info('[Alma] - PrestaShopException - Impossible to get Order with id :' . $idOrder);
Logger::instance()->error('[Alma] - PrestaShopException - Impossible to get Order with id :' . $idOrder);
return;
}
if ($order->module != ConstantsHelper::ALMA_MODULE_NAME || empty($order->getOrderPayments())) {
Logger::instance()->info('[Alma] - To Remove - Order is not Alma or payments are empty');
Logger::instance()->info('[Alma] - order module' . $order->module);
return;
}

Expand All @@ -73,7 +68,7 @@ public function run($params)
}
}
if (!isset($almaPaymentExternalId)) {
Logger::instance()->info('[Alma] - To Remove - No Alma Payment External Id');
Logger::instance()->error('[Alma] - No Alma Payment External Id in order ' . $order->reference);
return;
}

Expand Down

0 comments on commit 5e73e9d

Please sign in to comment.