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