# Shopware()-\>SessionID() is deprecated

**URL:** <https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533>\
**Category:** Programmierung\
**Created:** [29. Juli 2022 um 08:15 UTC](https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533 "2022-07-29T08:15:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![a67](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@a67](https://forum.shopware.com/u/a67)\
**Post date:** [29. Juli 2022 um 08:15 UTC](https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533/1 "2022-07-29T08:15:08Z")

</div>

Hallo zusammen,  
leider kann ich nun schon seit längerer Zeit kein Update auf die aktueller 5er Shopware-Version machen weil ein individuelles Plugin dann den Shop lahmlegt.

Der Freelancer, welcher uns das Plugin damals programiert hat meldet sich auch seit einem halben Jahr nicht mehr zurück.

Nun hoffe ich das mir jemand von euch helfen kann. In den Logs habe ich folgende Fehlermeldung gefunden, hier muss ich wohl in der Bootstrap.php einen Aufruf ändern:

```auto
Shopware()->SessionID() is deprecated since version 4.2 and will be removed in 5.8. Use the Container instead. Called by /var/www/vhosts/xxx.de/httpdocs/engine/Shopware/Plugins/Community/Frontend/PricegroupBlockprices/Bootstrap.php:313
Context: []

```

Es handelt sich wohl um folgende Programmteil:

```auto
    public function getTotalQuantityOfPricegroup($pricegroupID)
    {
        return Shopware()->Db()->fetchOne(
            "SELECT SUM(s_order_basket.quantity)
			 FROM s_order_basket
			 LEFT JOIN s_articles ON s_articles.id = s_order_basket.articleID
			 WHERE s_articles.pricegroupID = ?
			 AND sessionID = ?",
            array(
                // $articleToExclude ? intval($articleToExclude) : -1,
                intval($pricegroupID),
                Shopware()->SessionID()
            )
        ) ?: 0; // if no matching rows are found, return 0 instead of null
    }

```

Kann mir hier jemand helfen? Gerne auch gegen Berechnung.

Viele Grüße  
Alex

---

<div class="post-metadata">

**Author:** ![abdullah](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abdullah](https://forum.shopware.com/u/abdullah)\
**Post date:** [29. Juli 2022 um 08:36 UTC](https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533/2 "2022-07-29T08:36:07Z")

</div>

`Shopware()->Session()` verwenden sollte das Problem lösen.

---

<div class="post-metadata">

**Author:** ![a67](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@a67](https://forum.shopware.com/u/a67)\
**Post date:** [29. Juli 2022 um 09:21 UTC](https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533/3 "2022-07-29T09:21:06Z")

</div>

Hallo und danke für die schnelle Antwort.

Leider hat das nicht funktioniert…

---

<div class="post-metadata">

**Author:** ![sacrofano](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sacrofano](https://forum.shopware.com/u/sacrofano)\
**Post date:** [29. Juli 2022 um 11:14 UTC](https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533/4 "2022-07-29T11:14:08Z")

</div>

`Shopware()->Session()->get('sessionId')`

---

<div class="post-metadata">

**Author:** ![abdullah](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abdullah](https://forum.shopware.com/u/abdullah)\
**Post date:** [29. Juli 2022 um 11:28 UTC](https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533/5 "2022-07-29T11:28:34Z")

</div>

upps, mein Fehler. Wie @sacrofano beschrieben hat sollte es stimmen.

---

<div class="post-metadata">

**Author:** ![a67](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@a67](https://forum.shopware.com/u/a67)\
**Post date:** [29. Juli 2022 um 11:48 UTC](https://forum.shopware.com/t/shopware-sessionid-is-deprecated/95533/6 "2022-07-29T11:48:33Z")

</div>

> [@sacrofano](#):
>
> Shopware()-\>Session()-\>get(‚sessionId‘)

Das war es… vielen Dank für eure schnelle Hilfe.  
Endlich kann ich wieder Updates machen.
