Skip to content

Commit

Permalink
NTR: fix constants (#436)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitalij Mik <[email protected]>
  • Loading branch information
BlackScorp and Vitalij Mik authored Nov 25, 2024
1 parent ae2117a commit 550ac84
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Components/Services/StockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

use Enlight_Components_Db_Adapter_Pdo_Mysql;
use MollieShopware\Components\Config;
use MollieShopware\MollieShopware;
use Psr\Log\LoggerInterface;
use Shopware\Bundle\CartBundle\CartPositionsMode;
use Shopware\Models\Order\Status;

class StockService
{
/**
* cannot use Shopware\Bundle\CartBundle\CartPositionsMode constants, they dont exists in 5.7.3 and below
*/
const PRODUCT = 0;
const PREMIUM_PRODUCT = 1;
/**
* @var OrderService
*/
Expand Down Expand Up @@ -66,7 +68,7 @@ public function updateOrderStocks($orderId, $reset = true)
$this->logger->debug('Price is lower than 0, this product was not updated in first place', ['orderId' => $orderId, 'articleNumber' => $articleNumber, 'priceNumeric' => $orderDetail->getPrice()]);
continue;
}
if (! in_array($orderDetail->getMode(), [CartPositionsMode::PRODUCT, CartPositionsMode::PREMIUM_PRODUCT], true)) {
if (! in_array($orderDetail->getMode(), [self::PRODUCT, self::PREMIUM_PRODUCT], true)) {
$this->logger->debug('Order detail does not have a regular product', ['orderId' => $orderId, 'articleNumber' => $articleNumber, 'mode' => $orderDetail->getMode()]);
continue;
}
Expand Down

0 comments on commit 550ac84

Please sign in to comment.