ProductPriceCalculator example

/** * @internal * * @covers \Shopware\Core\Content\Product\SalesChannel\Price\ProductPriceCalculator */
class ProductPriceCalculatorTest extends TestCase
{
    private ProductPriceCalculator $calculator;

    protected function setUp(): void
    {
        $this->calculator = new ProductPriceCalculator(
            new StaticEntityRepository([
                new UnitCollection([(
                new UnitEntity())->assign(['id' => Defaults::CURRENCY, 'translated' => ['name' => 'test']])]),
            ]),
            new QuantityPriceCalculator(
                new GrossPriceCalculator(new TaxCalculator()new CashRounding()),
                new NetPriceCalculator(new TaxCalculator()new CashRounding())
            )
        );
    }

    
Home | Imprint | This part of the site doesn't use cookies.