# Lineitem setChildren Preis

**URL:** https://forum.shopware.com/t/lineitem-setchildren-preis/67003
**Category:** Programmierung
**Created:** [17. Mai 2020 um 15:31 UTC](https://forum.shopware.com/t/lineitem-setchildren-preis/67003 "2020-05-17T15:31:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ADA](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@ADA](https://forum.shopware.com/u/ADA)
#### Post date: [17. Mai 2020 um 15:31 UTC](https://forum.shopware.com/t/lineitem-setchildren-preis/67003/1 "2020-05-17T15:31:56Z")

</div>

Hallo,

aktuell füge ich „Zubehör Produkte“ als Child Lineitems hinzu.

Leider wird der Preis nicht im Warenkorb berechnet… nur vom Parentlineitems… die Childlineitems werden ignoriert.

```
$collection = new LineItemCollection();

$lineItem = new LineItem(...);
$collection->add($lineItem);
$definition = new QuantityPriceDefinition(
 $price,
 $cart->getPrice()->getTaxRules(),
 $context->getCurrency()->getDecimalPrecision(),
 (int) $value['quantity'] * $item->getQuantity(),
 true
);

$calculated = $this->calculator->calculate($definition, $context);
$lineItem->setPrice($calculated);

$eventLineItem->setChildren($collection);

```

Danke!

---

<div class="post-metadata">

### Author: ![inventivo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/inventivo/32/11397_2.png) [@inventivo](https://forum.shopware.com/u/inventivo)
#### Post date: [1. Juli 2020 um 07:43 UTC](https://forum.shopware.com/t/lineitem-setchildren-preis/67003/2 "2020-07-01T07:43:56Z")

</div>

Habe das mal als issue eingestellt.

[@Moritz Naczenski]([http://forum.shopware.com/profile/14574/Moritz](http://forum.shopware.com/profile/14574/Moritz) Naczenski “Moritz Naczenski”)‍ ‍ : Wurde das bereits in der 6.2.2 behoben?

Wann spielt Ihr die eigentich in den Master Branch des Production Templates? Aktuell ist da noch die 6.2.0 hinterlegt.  
Es wäre schön, die neuen Versionen doert auch immer zeitnah zur Verfügung zu haben.
