newTable() ->editColumn('thumbnail', function ($product) { return view('admin::partials.table.image', [ 'file' => $product->variant?->base_image ?? $product->base_image, ]); }) ->editColumn('price', function (Product $product) { return product_price_formatted($product->variant ?? $product, function ($price, $specialPrice) use ($product) { if ($product->variant ? $product->variant->hasSpecialPrice() : $product->hasSpecialPrice()) { return "{$specialPrice} {$price}"; } return "{$price}"; }); }); } }