How to get product stock?
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
How to get product stock?
Hello, I need to get the stock value of a product and I'm using the getStockItems function, but I have no results. My code looks like this:
Other functions like getCode () are normal, where am I missing?
Code: Select all
$newfunction = function( \Aimeos\MShop\Product\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ){
var_dump($item->getStockItems( ));
die();
}
Re: How to get product stock?
Stock items are only part of the product item if you pass "[..., 'stock']" as second parameter to the search/searchItems method. The list of domains for the second parameter can be configured if you aren't using custom code for that.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star