Handling different stock types
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!
Handling different stock types
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?
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?
Re: Handling different stock types
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
https://aimeos.org/docs/latest/frontend ... es/#basket
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
Re: Handling different stock types
Great, thank you. This is very useful.