# Zugriff im eigenen Controller auf Tempate Vars?

**URL:** <https://forum.shopware.com/t/zugriff-im-eigenen-controller-auf-tempate-vars/5256>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [25. November 2011 um 10:18 UTC](https://forum.shopware.com/t/zugriff-im-eigenen-controller-auf-tempate-vars/5256 "2011-11-25T10:18:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mac](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mac/32/7855_2.png) [@mac](https://forum.shopware.com/u/mac)\
**Post date:** [25. November 2011 um 10:18 UTC](https://forum.shopware.com/t/zugriff-im-eigenen-controller-auf-tempate-vars/5256/1 "2011-11-25T10:18:59Z")

</div>

Hallo, ich stehe gerade etwas auf dem Schlauch. Ich möchte in meinem eigenen Controller im Bestellprozess auf die Variable sShippingcostsDifference (Betrag bis Bestellung versandkostenfrei ist) zugreifen. Leider weiß ich nicht wie das funktioniert. Über die Klasse sBasket bekomme ich den Wert nicht. Kann mir da jemand helfen? Gruß Mac

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [29. November 2011 um 13:54 UTC](https://forum.shopware.com/t/zugriff-im-eigenen-controller-auf-tempate-vars/5256/2 "2011-11-29T13:54:15Z")

</div>

versuch es mal so: $view-\>sShippingcostsDifference

---

<div class="post-metadata">

**Author:** ![mac](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mac/32/7855_2.png) [@mac](https://forum.shopware.com/u/mac)\
**Post date:** [2. Dezember 2011 um 14:11 UTC](https://forum.shopware.com/t/zugriff-im-eigenen-controller-auf-tempate-vars/5256/3 "2011-12-02T14:11:44Z")

</div>

Das hat leider nicht funktioniert. Ich habe es jetzt so gelöst: ` $user = array(); $user = Shopware() -\> Modules() -\> Admin() -\> sGetUserData(); Shopware() -\> Modules() -\> Basket() -\> sCheckBasketBundles(); $basket = Shopware() -\> Modules() -\> Basket() -\> sGetBasket(); $country = Shopware() -\> Modules() -\> Admin() -\> sGetCountry( Shopware() -\> Session() -\> sCountry ? Shopware() -\> Session() -\> sCountry : 2); $paymentID = Shopware() -\> Session() -\> sPaymentID ? Shopware() -\> Session() -\> sPaymentID : 5; $paymentData = Shopware() -\> Modules() -\> Admin() -\> sGetPaymentMeanById($paymentID, $user); if (empty($country) || empty($paymentData)) { $view -\> myShipping = array('brutto' =\> 0, 'netto' =\> 0); } else { $shippingcostsDifference = Shopware() -\> Modules() -\> Admin() -\> sGetShippingcosts($country, $paymentData['surcharge'], $paymentData['surchargestring']); } $shippingcostsDifference = $shippingcostsDifference['difference']['float']; `
