This commit is contained in:
paoloar77
2025-01-28 18:03:39 +01:00
parent 14f5b113e2
commit 1c4e577e64

View File

@@ -998,6 +998,7 @@ class ArticleFormatter
private static function getStockInfo($product)
{
try {
if (!$product) {
return [
'stock_quantity' => 0,
@@ -1011,11 +1012,19 @@ class ArticleFormatter
if (isset($product['stock_quantity'])) {
$quantity = intval($product['stock_quantity']);
}
$price = '0';
if (isset($product['price'])) {
$price = $product['price'];
}
if (isset($product['sale_price'])) {
$price = $product['sale_price'];
}
} catch (e) {
}
return [
'quantity' => $quantity,
'price' => $price,