Skip to content

Commit

Permalink
Orders: log error when failing to convert from base price
Browse files Browse the repository at this point in the history
  • Loading branch information
supercid committed Dec 27, 2023
1 parent 1ef10ca commit b1cd81e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Model/Order/Item/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
use Magento\Framework\Exception\LocalizedException;
use Magento\Sales\Model\Order\Item;
use Nosto\Model\Cart\LineItem;
use Nosto\NostoException;
use Nosto\Tagging\Logger\Logger as NostoLogger;
use Nosto\Tagging\Model\Item\Downloadable;
use Nosto\Tagging\Model\Item\Giftcard;
Expand Down Expand Up @@ -142,6 +143,14 @@ public function build(Item $item)
}
$nostoItem->setPrice($price);
} catch (Exception $e) {
$this->logger->exception(
new NostoException(
sprintf(
'Could not calculate order item price, message was: %s',
$e->getMessage()
)
)
);
$nostoItem->setPrice(0);
}

Expand Down

0 comments on commit b1cd81e

Please sign in to comment.