discounted configurables
This commit is contained in:
parent
40ba2c8e77
commit
c4c2b9598c
|
|
@ -132,7 +132,7 @@ class Products extends ProductController
|
|||
// ->where('status',1)
|
||||
// ->orderBy('name','asc')
|
||||
->take(10)
|
||||
->query(fn ($query) => $query->select('id','name')->where('status',1)->orderBy('name'))
|
||||
->query(fn ($query) => $query->select('id','name')->orderBy('name'))
|
||||
->get();
|
||||
|
||||
if($brands->count()){
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class Product extends JsonResource
|
|||
'color_count' => $this->variants->groupBy('color')->count(),
|
||||
];
|
||||
|
||||
if( $special_variant = $this->variants()->whereNotNull('special_price')->orderBy('special_price')->first()){
|
||||
if( $special_variant = $this->variants->whereNotNull('special_price')->orderBy('special_price')->first()){
|
||||
$data = array_merge($data, [
|
||||
'special_price' => $special_variant->special_price,
|
||||
'formatted_special_price' => core()->currency($special_variant->special_price),
|
||||
|
|
|
|||
Loading…
Reference in New Issue