/** @var FlashBag $sessionBag */
$sessionBag =
$this->
getSession()->
getBag('flashes'
);
return $sessionBag;
} private function createProduct(string
$productId, string
$productNumber, bool
$hasChildren = false
): void
{ $context = Context::
createDefaultContext();
/** @var string $taxId */
$taxId =
$this->
getContainer()->
get('tax.repository'
)->
searchIds(new Criteria(),
$context)->
firstId();
$product =
[ 'id' =>
$productId,
'name' => 'Test product',
'productNumber' =>
$productNumber,
'stock' => 1,
'price' =>
[ ['currencyId' => Defaults::CURRENCY, 'gross' => 15.99, 'net' => 10, 'linked' => false
],
],
'taxId' =>
$taxId,
'categories' =>
[ [