Ability to add products to Suggested products by ID
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!
-
- Posts: 27
- Joined: 02 Feb 2022, 10:43
Ability to add products to Suggested products by ID
Laravel version: 8.80
Aimeos version: 2021.10
PHP version: 8.0.8
In the product catalog in the admin panel, we have column CODE. While importing products using CSV in Suggested products by CODE everything works fine. But when I try to add products manually, I cannot use CODE but only LABEL.
Is it possible to add products not by LABEL?
Aimeos version: 2021.10
PHP version: 8.0.8
In the product catalog in the admin panel, we have column CODE. While importing products using CSV in Suggested products by CODE everything works fine. But when I try to add products manually, I cannot use CODE but only LABEL.
Is it possible to add products not by LABEL?
- Attachments
-
- Screenshot_30.png (26.3 KiB) Viewed 2397 times
Last edited by santfather on 16 Mar 2022, 08:15, edited 1 time in total.
Re: Ability to add products to Suggested products by ID
Can you explain in more detail? Don't know what's the problem and maybe describing the problem step by step helps.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 27
- Joined: 02 Feb 2022, 10:43
Re: Ability to add products to Suggested products by ID
the product catalog contains a large number of products (more than 250,000).
some SELECT-type products contain additional products that can be added to the Suggested products, Products bought together and Stylization blocks (made for an online store). To add products to these areas, you can use LABEL (or drop down list)or CODE (when importing products using CSV). the question is to be able to add products not by LABEL but by CODE it doesn't work that way
some SELECT-type products contain additional products that can be added to the Suggested products, Products bought together and Stylization blocks (made for an online store). To add products to these areas, you can use LABEL (or drop down list)or CODE (when importing products using CSV). the question is to be able to add products not by LABEL but by CODE it doesn't work that way
Re: Ability to add products to Suggested products by ID
The suggested items are fetched here:
https://github.com/aimeos/ai-admin-jqad ... ct.js#L677
If the "key" can be a list of keys too, then it's possible to do add OR condition here:
https://github.com/aimeos/ai-admin-jqad ... #L206-L212
Required change in product.js:
Required change in admin.js:
Something like this. If you create a PR, we will merge it into the core so you don't have to overwrite and maintain it yourself 
https://github.com/aimeos/ai-admin-jqad ... ct.js#L677
If the "key" can be a list of keys too, then it's possible to do add OR condition here:
https://github.com/aimeos/ai-admin-jqad ... #L206-L212
Required change in product.js:
Code: Select all
Aimeos.getOptions(request, response, element, 'product', ['product.label', 'product.code'], 'product.label', null, labelFcn);
Code: Select all
var compare = {'||': []};
keys = Array.isArray(key) ? key : [key];
for(entry of keys) {
let term = {};
term[entry] = request.term;
compare['||'].push({'=~': term});
}
list = criteria ? [compare, criteria] : compare;

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 27
- Joined: 02 Feb 2022, 10:43
Re: Ability to add products to Suggested products by ID
Thanks for the reply. I will try
-
- Posts: 27
- Joined: 02 Feb 2022, 10:43
Re: Ability to add products to Suggested products by ID
yes. it helped. thank you very much