Handling different stock types

How to configure and adapt Aimeos based shops as developer
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!
yeh
Posts: 39
Joined: 27 Jun 2022, 13:26

Handling different stock types

Post by yeh » 12 Oct 2022, 15:24

I am trying to set up a system with different stock types to handle having 2 stock locations.

The standard stock amount will be the main stock level that is used, with admins able to also add stock to location two by setting the stock type to "location 2" in the stock settings.

What I want to happen is when a product is purchased that has any stock in location 2, that stock should be decreased first, with standard stock only being decreased once location 2 stock is at zero.

I have already added the location 2 stock type and this can be selected and set on the product stock pages, but I'm not sure which decorator to use to handle decreasing the different amounts. Would the mshop/stock/manager/decorators/global decorator be the right one to use?

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

Re: Handling different stock types

Post by aimeos » 13 Oct 2022, 09:41

You can select the used stock type if you send the "b_stocktype" or "b_prod[0][stocktype]" parameter to the basket:
https://aimeos.org/docs/latest/frontend ... es/#basket
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yeh
Posts: 39
Joined: 27 Jun 2022, 13:26

Re: Handling different stock types

Post by yeh » 18 Oct 2022, 12:13

Great, thank you. This is very useful.

Post Reply