aaa
This commit is contained in:
@@ -1000,6 +1000,7 @@ class ArticleFormatter
|
||||
{
|
||||
if (!$product) {
|
||||
return [
|
||||
'stock_quantity' => 0,
|
||||
'quantity' => 0,
|
||||
'price' => '',
|
||||
'color' => 'black',
|
||||
@@ -1007,9 +1008,14 @@ class ArticleFormatter
|
||||
];
|
||||
}
|
||||
|
||||
$quantity = intval($product['stock_quantity']);
|
||||
$price = $product['sale_price'] ?: $product['price'];
|
||||
|
||||
if (isset($product['stock_quantity'])) {
|
||||
$quantity = intval($product['stock_quantity']);
|
||||
}
|
||||
$price = $product['price'];
|
||||
if (isset($product['sale_price'])) {
|
||||
$price = $product['sale_price'];
|
||||
}
|
||||
|
||||
return [
|
||||
'quantity' => $quantity,
|
||||
'price' => $price,
|
||||
|
||||
Reference in New Issue
Block a user