discounted configurables

This commit is contained in:
merdan 2022-04-21 17:00:33 +05:00
parent 9f8bc6de23
commit e4a9ca873e
2 changed files with 2 additions and 1 deletions

View File

@ -169,6 +169,7 @@ class Products extends ProductController
public function searchProducts(){
return $this->productRepository->searchProductByAttribute(request('key'));
return ProductResource::collection($this->productRepository->searchProductByAttribute(request('key')));
}

View File

@ -215,7 +215,7 @@ class Product extends JsonResource
'color_count' => $this->variants->groupBy('color')->count(),
];
Log::info($this->variants);
// 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,