Fetch product refItems with their stock levels
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 12
- Joined: 23 Feb 2020, 10:32
Fetch product refItems with their stock levels
I can get list of variant products for a particular product by using
What I want is to get ref items along with their stock levels. Also I tried looping through refitems but there's no "stock" domain right?
So what method returns the stock data related to a product?
Code: Select all
$item->getRefItems('product')
So what method returns the stock data related to a product?
Re: Fetch product refItems with their stock levels
There's no easy way yet to retrieve the stock items associated to the product items. getRefItems() won't help because these are only the items that are referenced by the mshop_product_list table.
There are already two methods that do something similar you need:
- getCatalogItems()
- getSupplierItems()
We've added a new method getStockItems() now and ported that back to 2019.10 too. If you execute
you can use the new method afterwards:
There are already two methods that do something similar you need:
- getCatalogItems()
- getSupplierItems()
We've added a new method getStockItems() now and ported that back to 2019.10 too. If you execute
Code: Select all
composer req aimeos/aimeos-core:2019.10.x-dev
Code: Select all
$product->getStockItems()
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