# Laststock &gt; StoreFrontBundle ProductService

**URL:** <https://forum.shopware.com/t/laststock-gt-storefrontbundle-productservice/33998>\
**Category:** Programmierung\
**Created:** [28. Januar 2016 um 10:34 UTC](https://forum.shopware.com/t/laststock-gt-storefrontbundle-productservice/33998 "2016-01-28T10:34:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreischild](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@dreischild](https://forum.shopware.com/u/dreischild)\
**Post date:** [28. Januar 2016 um 10:34 UTC](https://forum.shopware.com/t/laststock-gt-storefrontbundle-productservice/33998/1 "2016-01-28T10:34:53Z")

</div>

Hallo zusammen,

bin gerade ein wenig mit den neuen Services am spielen und habe hierzu eine Frage. Ich habe jetzt schon gesucht und im Source nachgeschaut, doch&nbsp;  
finde einfach nicht die Methode / Weg, um auszulesen, ob es sich um einen laststock Artikel handelt.&nbsp;&nbsp;

$this-\>contextService = Shopware()-\>Container()-\>get(‘shopware\_storefront.context\_service’);  
$this-\>productService = Shopware()-\>Container()-\>get(‘shopware\_storefront.product\_service’);

…

/\*\* @var&nbsp;\Shopware\Bundle\StoreFrontBundle\Struct\Product \*\*/  
$product = $this-\>productService-\>get($orderNumber, $this-\>contextService-\>getProductContext());

Sowas wie “$product-\>isLaststock()” gibt es leider nicht im Product Struct?!

Danke und viele Grüße,  
Dennis

---

<div class="post-metadata">

**Author:** ![dreischild](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@dreischild](https://forum.shopware.com/u/dreischild)\
**Post date:** [28. Januar 2016 um 11:41 UTC](https://forum.shopware.com/t/laststock-gt-storefrontbundle-productservice/33998/2 "2016-01-28T11:41:52Z")

</div>

Hab´s jetzt schon selber gefunden. Trotzdem danke!&nbsp;

Für alle die es interessiert:

$product = $productService-\>getProductByOrderNumber($position[‘articleordernumber’]);

/\*\* @var \Shopware\Bundle\StoreFrontBundle\Struct\Product\Unit $productUnit \*/  
$productUnit = $product-\>getUnit();

$position[‘instock’] = $product-\>getStock();  
$position[‘laststock’] = $product-\>isCloseouts();  
$position[‘sVariants’] = $product-\>hasAvailableVariant();  
$position[‘minpurchase’] = $productUnit-\>getMinPurchase();  
$position[‘maxpurchase’] = $productUnit-\>getMaxPurchase();  
$position[‘purchasesteps’] = $productUnit-\>getPurchaseStep();  
$position[‘packunit’] = $productUnit-\>getUnit();

&nbsp;

Viele Grüße,

Dennis
