Get stock in list and favorites

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
loeffe1
Posts: 52
Joined: 21 Feb 2020, 10:33

Get stock in list and favorites

Post by loeffe1 » 16 Jun 2023, 14:01

I am trying to get the product stock but it just won't work. I tried setting

Code: Select all

    client {
      html {
        account {
          favorite {
            domains {
              1 = text
              2 = price
              3 = media
              4 = attribute
              5 = product
              6 = stock
            }
          }
        }
      }
    }
but am still only getting media, price and text.

Also overwriting Aimeos\Client\Html\Account\Favorite\Standard.php with a custom class and declaring it in typoscript and adding 'stock' to the list of domains, has no effect at all. Same goes for the product list. What am I doing wrong?

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Get stock in list and favorites

Post by aimeos » 20 Jun 2023, 06:16

Which Aimeos version are you using?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
loeffe1
Posts: 52
Joined: 21 Feb 2020, 10:33

Re: Get stock in list and favorites

Post by loeffe1 » 20 Jun 2023, 07:46

I'm using version 22.10

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Get stock in list and favorites

Post by aimeos » 21 Jun 2023, 14:36

How do you retrieve the stock items? Can you show example code?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
loeffe1
Posts: 52
Joined: 21 Feb 2020, 10:33

Re: Get stock in list and favorites

Post by loeffe1 » 22 Jun 2023, 08:00

I don't, because there isn't anything to retreive. I would expect stock to be available in getRefItems as it is the case with the other domains, but it's not in there.

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Get stock in list and favorites

Post by aimeos » 22 Jun 2023, 16:02

No, stock items are not referenced via the mshop_product_list table. Use this instead:

Code: Select all

$stockItems = $product->getStockItems();
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
loeffe1
Posts: 52
Joined: 21 Feb 2020, 10:33

Re: Get stock in list and favorites

Post by loeffe1 » 11 Jul 2023, 14:59

Thank you!

Post Reply