swag-docs-bundle-example
swag-docs-bundle-example copied to clipboard
getCurrencyPrecision not available since shopware 6.4.0
https://github.com/shopware/swag-docs-bundle-example/blob/4d787fd898a2c7c2d1b7edf403183668cd46c6c9/src/Core/Checkout/Bundle/Cart/BundleCartProcessor.php
the method 'getCurrencyPrecision' is not part of the context class anymore.
same here
@fgiering you can just leave it out.
@fgiering you can just leave it out.
You mean like:
$priceDefinition = new AbsolutePriceDefinition($bundleData->getDiscount() * -1);
instead of
$priceDefinition = new AbsolutePriceDefinition($bundleData->getDiscount() * -1, $context->getContext()->getCurrencyPrecision());
?
yep, exactly
Then I get a RuntimeException
Product "" has invalid price definition
Can you Debug it a bit more, which value is set there? In Shopware 6.4.0 I used it with a static integer like:
$lineItem->setPriceDefinition( new AbsolutePriceDefinition(5) )
This works fine for me Maybe you got there a float with more than 2 decimal places ?
Got it. There was an inactive Product in the Bundle.