Hi,
For your info, the cart bundle master has been refactored in such a
way that all pricing logic previously part of the cart / cart item
model has been moved into a dedicated pricing provider class. A
Simple pricing provider class is bundled with the cartbundle
containing basic cart handling:
https://github.com/vespolina/VespolinaCartBundle/blob/master/Pricing/SimpleCartPricingProvider.php
. The cart bundle works with both ODM and ORM.
In addition the cart item & cart have a field "prices" which now
stores all prices (eg. "totalPrice", "unitPrice", ...). Depending on
your own use case you might want to add other pricing fields at
runtime.
You can use $cart->getPrice('totalPrice') to get a particular pricing
value at cart level, the same concept exists at cart item level.
You can specify your own pricing provider using following
configuration:
vespolina_cart:
pricing_provider:
class: YourAwesomePricingProviderClass
It's also possible to disable pricing. This means that no pricing
calculation will ever happen. To do that, you specify:
vespolina_cart:
pricing_provider:
enabled: false
Recalculating pricing at both cart & cart item level is done by
calling determinePrices method of the cart manager.
$cartManager->determinePrices($aCart);