# Bestellung: custom line item Bug?

**URL:** <https://forum.shopware.com/t/bestellung-custom-line-item-bug/64579>\
**Category:** Programmierung\
**Created:** [10. Februar 2020 um 11:54 UTC](https://forum.shopware.com/t/bestellung-custom-line-item-bug/64579 "2020-02-10T11:54:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![binaermanufaktur](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@binaermanufaktur](https://forum.shopware.com/u/binaermanufaktur)\
**Post date:** [10. Februar 2020 um 11:54 UTC](https://forum.shopware.com/t/bestellung-custom-line-item-bug/64579/1 "2020-02-10T11:54:14Z")

</div>

&nbsp;Wenn ich die Bestellung bearbeite und dann ein custom Lineitem hinzufüge, wird das subtotal nicht richtig berechne. Ich kann einen Price und eine Quantity angeben, aber das Subtotal wird nicht entsprechend berechnet.

Ist das ein Bug oder habe ich etwas nicht beachtet?

Danke!

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [10. Februar 2020 um 12:01 UTC](https://forum.shopware.com/t/bestellung-custom-line-item-bug/64579/2 "2020-02-10T12:01:39Z")

</div>

Ja, kann ich nachstellen.

Dazu habe ich ein Ticket aufgemacht:&nbsp;[Shopware Issuetracker](https://issues.shopware.com/issues/NEXT-6936)

---

<div class="post-metadata">

**Author:** ![binaermanufaktur](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@binaermanufaktur](https://forum.shopware.com/u/binaermanufaktur)\
**Post date:** [10. Februar 2020 um 12:04 UTC](https://forum.shopware.com/t/bestellung-custom-line-item-bug/64579/3 "2020-02-10T12:04:56Z")

</div>

Danke!

---

<div class="post-metadata">

**Author:** ![binaermanufaktur](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@binaermanufaktur](https://forum.shopware.com/u/binaermanufaktur)\
**Post date:** [14. Februar 2020 um 09:46 UTC](https://forum.shopware.com/t/bestellung-custom-line-item-bug/64579/4 "2020-02-14T09:46:33Z")

</div>

Noch eine Nachfrage hierzu:

Ist es gewolltes Verhalten, dass ein ProductLineItem, das per

```
 Shopware\Core\Content\Product\Cart\ProductLineItemFactory

```

erzeugt wird, sich im Nachhinein nicht mehr ändern lässt? Also setLabel, setQuantity, setPriceDefinition keine Auswirkung auf das LineItem haben?

Bsp:

(sorry markup nach edit sieht komisch aus)

```
$product = $productLineItemfactory->create($productId);
$product->setLabel('test');
$product->setQuantity(5);
$taxRule = new TaxRule(19);
$quantityPriceDefinition = new QuantityPriceDefinition(100,new TaxRuleCollection([$taxRule]),2);
$product->setPriceDefinition($quantityPriceDefinition);

```

das gedumpte LineItem sieht wie folgt aus:

```
{
  "id": "1e06374624b54356911d539d73db6ec0",
  "referencedId": "1e06374624b54356911d539d73db6ec0",
  "label": "Rustic Steel Clean Grooves",
  "quantity": 1,
  "type": "product",
  "payload": {
    "tags": null,
    "categories": [
      "80956d03d8284aef882f8f2872dd7590",
      "0c88065894f8445395c104f2772d0a45",
      "4e9f65d780114d168d724dda3f322cbf"
    ],
    "properties": [
      "05bb2f05b2294d8eb2d5d426b280609a",
      "11587296c685423e93b094de09ba7180",
      "12849fd86de24d89a9fc5614f1d79e2c",
      "290c1fc56e92493587033672d0e79042",
      "2d6acda4abea46b7ae284a2df954323c",
      "3f04813041f649f4b679e0780ff1c6b0",
      "52b26c30199d476fa7e9fd4261c6ab85",
      "7db7836e663841d5b14f2c4f63e79c95",
      "8431c42ef97d4826964d051f18aa8c25",
      "8cf8d8213d394fa994d6886b75fc6f3b",
      "9679738ccd4d41938a7eb89967d8fc18",
      "bbddcb38421a4f8e95162696b808ed63",
      "c856f6b221e6478d9656c0c4367ebe5a",
      "cef423f419314e0c8f4fbdf286125a3b",
      "d60ebb148e3446869e2990006187ef1d",
      "e69270e2a062499ab9848bc8783742b1",
      "eb7fb21b597249f8ba8999247ee3c992",
      "f4c28ddb517f439b855eedee48cbf813"
    ],
    "productNumber": "c634f0315e7d4536b2e5224eb3797679",
    "options": []
  },
  "priceDefinition": {
    "price": 967,
    "taxRules": [
      {
        "taxRate": 7,
        "percentage": 100,
        "extensions": []
      }
    ],
    "quantity": 1,
    "isCalculated": true,
    "precision": 2,
    "referencePriceDefinition": null,
    "listPrice": null,
    "extensions": [],
    "type": "quantity"
  },
  "price": {
    "unitPrice": 967,
    "quantity": 1,
    "totalPrice": 3868,
    "calculatedTaxes": [
      {
        "tax": 253.05,
        "taxRate": 7,
        "price": 3868,
        "extensions": []
      }
    ],
    "taxRules": [
      {
        "taxRate": 7,
        "percentage": 100,
        "extensions": []
      }
    ],
    "referencePrice": null,
    "listPrice": null,
    "extensions": []
  },
usw.usf.

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![binaermanufaktur](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@binaermanufaktur](https://forum.shopware.com/u/binaermanufaktur)\
**Post date:** [24. Februar 2020 um 09:36 UTC](https://forum.shopware.com/t/bestellung-custom-line-item-bug/64579/5 "2020-02-24T09:36:39Z")

</div>

[https://issues.shopware.com/issues/NEXT-6936](https://issues.shopware.com/issues/NEXT-6936)

Wann wird klar, in welche Version der Fix kommt?

Danke!
