Size option with they own quantity stock

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)
User avatar
Crisis2010
Posts: 5
Joined: 12 Sep 2019, 01:01

Size option with they own quantity stock

Post by Crisis2010 » 12 Sep 2019, 01:29

Hello! I am wildly sorry if this question has already been asked, but it is not entirely clear to me to implement the necessary things correctly.

I’m going to transfer my online store, and I need the ability to create product that has different sizes and each size has its own quantity in stock, which will decrease upon purchase.

Something like this:
Image
This is screenshot from admin panel from my current shop, where i created 1 product with size options, which has Custom created collection of named options (XS or S and etc.), Quantity, Custom Price.

So i have an product, that will have options:
1. Color (every color like product, which have they own sizes in stock)
2. Size (and size should have)
- S (1 quantity at stock)
- M (2 quantity at stock)

So for example:
1 Product with option color Green (total quantity 5 = 3 + 1 + 1 :) )
- xs size (quantity 3)
- s size (quantity 1)
- m size (quantity 1)
So if someone buy M size, for example, then M size will removed from frontend product cart because M size quantity will be reduced to zero:
1 Product with option color Green (total quantity 4 = 3 + 1 + 0 )
- xs size (quantity 3)
- s size (quantity 1)
- m size (quantity 0 - not visible at product page)

I found the answer that i can create product with 'Selection' and add variant articles, but that means that i need to create every size as a separate product without image like example in demo?
This is extremely inconvenient and will turn the list of products into a giant list, because I have sizes from xs to 14xxl, so if one product will have every size from xs to 14xxl with quantity 1 or 2 of every size - that means i will have more than 15 items in admin list, like this:
Image

I hope I clearly explained everything)
Is there any other way to do that more easier?

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

Re: Size option with they own quantity stock

Post by aimeos » 12 Sep 2019, 07:15

If products of different sizes and colors need their own stock level, you have to use a selection product with articles for each size/color combination including the actual stock level. You can create them quickly in the "Selection" tab of the product detail view when selecting "Selection" as product type. Each article can also have its own image, price and so on but you have to go into the product detail view of each article to add them.

For large product catalogs, using an Excel sheet saved as CSV file is a better alternative. You can configure the mapping of the column and import them via the product/import/csv job controller executed by a cron job:
https://aimeos.org/docs/Developers/Cont ... s_from_CSV
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Crisis2010
Posts: 5
Joined: 12 Sep 2019, 01:01

Re: Size option with they own quantity stock

Post by Crisis2010 » 12 Sep 2019, 20:19

Yeah, thanks, got it.

But now i got strange problem:
Well, actually, I’m trying to make a Selection item with different Articles. As I properly understand – I need to use SKU field to match articles (the same SKU’s) to Variants field in selection item, also the Label fields. Ok, I’m doing it and I receive this error.
Image
Image
Well, it’s just a 1 for 1 copy of example fields in template examples, for last. Tried different syntax and nothing helped, always a constraint violation error
Got no solution now, tried really everything. Even remove from demo "demo-selection-article" example and add same variant back.

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

Re: Size option with they own quantity stock

Post by aimeos » 13 Sep 2019, 09:20

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

User avatar
Crisis2010
Posts: 5
Joined: 12 Sep 2019, 01:01

Re: Size option with they own quantity stock

Post by Crisis2010 » 13 Sep 2019, 17:52

Sorry, forgot to write:
"php": "^7.2",
"aimeos/aimeos-core": "^2019.07.9",
"aimeos/aimeos-laravel": "^2019.07",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0",
"laravel/tinker": "^1.0",
"laravel/ui": "^1.0"
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"

Also seems like there are problem with upload product image, it's just empty after select image in explorer.
Screenshot:
Image
Image on frontend looks exactly the same - nothing. Tried many images with different sizes.

Probably, all this problem because of Laravel 6.0?

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

Re: Size option with they own quantity stock

Post by aimeos » 13 Sep 2019, 18:17

Can you please run

Code: Select all

composer req aimeos/ai-admin-jqadm:2019.07.x-dev
There was a bug that prevented that you can select an article from a suggestion list after entering at least three chars of the article SKU.

The problem with your images is not related to Laravel 6. Please correct your APP_URL setting in your .env file esp. the host and port must match to your URL in your browser.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Crisis2010
Posts: 5
Joined: 12 Sep 2019, 01:01

Re: Size option with they own quantity stock

Post by Crisis2010 » 13 Sep 2019, 18:56

Nope, still:
ErrorSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-demo-selection-article-2' for key 'unq_mspro_siteid_code', /Users/toothless/dev_sites/laravelodog/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/DB/Statement/DBAL/Simple.php:91

Yeah, problem with images was been because of httpS in url, now it's ok, thanks!

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

Re: Size option with they own quantity stock

Post by aimeos » 14 Sep 2019, 20:21

Please keep in mind that there must be a list of suggested products (otherwise, something is wrong and you MUST select one of those options. If you don't do that, you don't use an existing article but will create a new one. That will fail if already an article with the same SKU exists like in your case.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Crisis2010
Posts: 5
Joined: 12 Sep 2019, 01:01

Re: Size option with they own quantity stock

Post by Crisis2010 » 15 Sep 2019, 18:26

Yeah, now it's ok, thanks!

Post Reply