Categories instead of Products? (trying to add multiple products to category)

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
alexkereszturi
Posts: 8
Joined: 24 Dec 2024, 11:16

Categories instead of Products? (trying to add multiple products to category)

Post by alexkereszturi » 24 Dec 2024, 11:21

Hi forum!

Trying to add products to a category (using Typo3). When searching for a product it lists categories: (see png)

Bug? Can I "debug" that on our side somehow? Maybe anyone changed a file he shouldn't.
Thx for any hint.
Attachments
4045f8a56bd8205738f641266c2c8d5c4c86bc4e3b89b580e9cd6c1313eebf7d.png
4045f8a56bd8205738f641266c2c8d5c4c86bc4e3b89b580e9cd6c1313eebf7d.png (84.56 KiB) Viewed 13135 times

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

Re: Categories instead of Products? (trying to add multiple products to category)

Post by aimeos » 24 Dec 2024, 11:26

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

User avatar
alexkereszturi
Posts: 8
Joined: 24 Dec 2024, 11:16

Re: Categories instead of Products? (trying to add multiple products to category)

Post by alexkereszturi » 31 Dec 2024, 01:59

Aimeos: 23.10.8

Additional Info: the "same same" happens when trying to add products to suppliers => suppliers are listed instead of products :roll:

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

Re: Categories instead of Products? (trying to add multiple products to category)

Post by aimeos » 02 Jan 2025, 14:37

What's the network request when the "product" selector opens to list the suggestions? Please have a look into the network console of your browser.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star


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

Re: Categories instead of Products? (trying to add multiple products to category)

Post by aimeos » 23 Jan 2025, 09:41

The URL looks OK and should return categories. Is that the case in the response?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
alexkereszturi
Posts: 8
Joined: 24 Dec 2024, 11:16

Re: Categories instead of Products? (trying to add multiple products to category)

Post by alexkereszturi » 27 Jan 2025, 02:50

Yes, the response delivers categories. But it shold deliver products.
So the query is ok ... but it's the wrong query for the task: I want to add a product to a category!

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

Re: Categories instead of Products? (trying to add multiple products to category)

Post by aimeos » 27 Jan 2025, 15:21

The Javascript that fetches the items is here:
https://github.com/aimeos/ai-admin-jqad ... #L370-L402

The "domain" seems to be used wrongly and nobody noticed that up to now. Can you replace it with the code below and check if it works?

Code: Select all

			suggest(input, loadfcn) {
				const self = this;
				const args = {
					'filter': {'||': [
						{'==': {}},
						{'=~': {}},
						{'=~': {}}
					]},
					'fields': {},
					'page': {'offset': 0, 'limit': 25},
					'sort': 'product.label'
				};
				args['filter']['||'][0]['==']['product.id'] = input;
				args['filter']['||'][1]['=~']['product.code'] = input;
				args['filter']['||'][2]['=~']['product.label'] = input;
				args['fields']['product'] = ['product.id', 'product.code', 'product.label'];

				try {
					loadfcn ? loadfcn(true) : null;

					this.get('product', args, function(data) {
						self.options = [];
						(data.items || []).forEach(function(entry) {
							self.options.push({
								'id': entry['product.id'],
								'label': entry['product.id'] + ' - ' + entry['product.label'] + ' (' + entry['product.code'] + ')'
							});
						});
					});
				} finally {
					loadfcn ? loadfcn(false) : null;
				}
			},
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
alexkereszturi
Posts: 8
Joined: 24 Dec 2024, 11:16

Re: Categories instead of Products? (trying to add multiple products to category)

Post by alexkereszturi » 28 Jan 2025, 15:00

the code change works! thanks!

Will it be in the next release/update?

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

Re: Categories instead of Products? (trying to add multiple products to category)

Post by aimeos » 29 Jan 2025, 10:29

It has been fixed now. Please update the aimeos/ai-admin-jqadm package to "2023.10.x-dev"
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply