During #2831613: Meta: Product bundle price resolution I stubled upon some inconsistencies in our current implementation. If we have a freshly instantiated BundleItem, we blow away by calling methods, that require variations to be there (getUnitPrice).
ATM this is:
::getDefaultVariation()
::getCurrentVariation()
::getUnitPrice()
So we have to Options.
a) Check if we have a product reference or some variations before doing the logic in these three methods.
b) Overwrite the constructor and require product or variations at instatiation time.
I think a) is what is more DI friendly. Lets just make sure we don't fatal if the BundleItem issed fully setup.
Any thoughts?
Comments
Comment #3
olafkarsten commentedfixed with #2929653: Adjust Bundle Item Interface and BundleItem Class to enforce that all variants are from the same product