aa
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user