Commerce Product Bundle implements PurchaseableEnityInterface, which offers getPrice() method to return a price for a given bundle. Current implementation doesn't use PriceResolver, but instead, it returns a (opinionated) price from the best practice or the most common use case if a static price is not set.
Commerce's PriceResolver offers a way for system to decide on a way to get a price, which allows other contributed modules to override the default / most common calculated price. Below are 2 use cases that would benefit:
1. If a bundle is added to commerce_pricelist, but the bundle_price is now (suggesting dynamic pricing), then commerce_pricelist can override the PriceResolver and detect the complex situation and therefore disable the price form for editing
2. Some site might want to return the highest price from a bundle instead of the first price, when there is no static price set.
Todo:
Move the current getPrice() code and logic into a PriceResolver class.
Comments
Comment #2
skyredwangComment #3
olafkarsten commentedComment #5
olafkarsten commentedThat probably isn't BC.