discounted configurables

This commit is contained in:
merdan 2022-04-21 16:56:48 +05:00
parent 3a8ecf6803
commit 9f8bc6de23
1 changed files with 1 additions and 0 deletions

View File

@ -215,6 +215,7 @@ class Product extends JsonResource
'color_count' => $this->variants->groupBy('color')->count(),
];
Log::info($this->variants);
if( $special_variant = $this->variants->whereNotNull('special_price')->sortBy('special_price')->first()){
$data = array_merge($data, [
'special_price' => $special_variant->special_price,