In the cost estimating feature of solidworks, there is a place where one can set a purchase price for each part. But I haven't seen anything that would allow us to define prices according to quantities (which would be closer to reality).
Is it in a hidden menu somewhere? Or is it not supported?
You have to do the cost yourself by creating a column in the nomenclature "Cost" and "Total" to add up all the costs by equation. A column "Unit cost" can be established which can be multiplied by the quantities to give the cost of the whole. This is done well in mechanical welding where a price per linear meter is used.
Welding also makes it possible to set prices per type of welding per linear meter directly in the properties of the welding seam.
Otherwise, there is of course the Costing tool which allows you to set the price of a part according to its method of obtainment: machined, sheet metal.