discounted configurables

This commit is contained in:
merdan 2022-04-21 16:49:03 +05:00
parent 40ba2c8e77
commit c4c2b9598c
2 changed files with 2 additions and 2 deletions

View File

@ -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()){

View File

@ -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),