Conversation
There was a problem hiding this comment.
Old one was nice as well ;)
|
But you display wrong price in frontend? |
|
@winzou Ah, true. Missed that :) Will fix, thanks. |
|
Cool stuff 👍 |
There was a problem hiding this comment.
Default calculator simply returns the variant price.
|
I would totally separate the formatting from the calculation. Like this: |
|
Agree with @winzou on function style. Maybe And beside variant, should we accept |
|
TBH. it's kinda confusing for me where to put this code. IMO it's not totally correct to have it in the CoreBundle, while all prices are being calculated by MoneyBundle... I'm confused. Anyway, we can't depend on |
|
@stloyd Where does MoneyBundle calculate price? I thought MoneyBundle was just doing currency exchange. If we put PriceCalculator to MoneyBundle, that would make MoneyBundle depends on Variant wouldn't it? |
|
PricingBundle. Would be cool to put it there... I'll put your implementation on steroids later. (add optional configuration to pricing calculators) What do you think? |
|
And I'd go with |
|
@pjedrzejewski I would say that bundle is overkill, component sound ok but bundle is overkill ;) But totally agree about that interface, I was thinking about same thing, but placed in ProductBundle, or in MoneyBundle, but prefer the first one |
|
IMHO, it definitely should be a separate bundle. In @umpirsky implementation it is quite thin, but for sure it will contain much more and can be used separately from Product bundle. Why would you couple the pricing stuff only to Product bundle? |
|
@winzou I agree about @pjedrzejewski I agree about |
|
@umpirsky Deal! 👍 |
|
@pjedrzejewski Ready for merging. Just waiting for Travis. |
|
@pjedrzejewski Can you merge it please? |
|
Thanks Sasha! The build was failing previously. Nice work! 👍 |
Fixes issue #1120.
This will allow us to have custom price calculators. For example, we have something like this in our project.