Description
Preconditions and environment
- Magento version 2.4.5
We are trying to update a model through the Magento 2.4 REST API following the official guide published in Create a configurable product using bulk APIs.
Our query is about Defining configurable product options. When creating configurable-product options (POST /rest/default/async/bulk/V1/configurable-products/bySku/options) we are asked to add the values of the options, for example, if the configurable varies by "Color" we add the ids of the corresponding colors, here an example:
[
{
"sku": "61784",
"option": {
"attribute_id": "684",
"label": "Golor",
"position" means 0,
"values": [
{
"value_index": 11905
}
],
"is_use_default": true
}
}
]
But the result is not as expected, since the option is not created in the attribute configurable_product_options, which appears empty:
"configurable_product_options" : [
{
"id": 27296,
"attribute_id": "684",
"label": "Golor",
"position" means 0,
"values": [],
"production" means: 47435
}
],
This causes that in step 4, when trying to link variants to the configurable product, the service returns an error saying that it is not possible to do so since configurable does not have those options available:
{
"operations_list": [
{
"id" means 0,
"status": 3,
"result_message": "The parent product doesn’t have configurable product options.",
"error_code": 0
}
],
"user_type": 1,
"bulk_id": "bb4a7....",
"description": "Topic async.magento.configurableproduct.api.linkmanagementinterface.addchild.post",
"start_time": "2023-07-18 13:53:35",
"user_id": 2,
"operation_count": 1
}
On the other hand, I have tried to inform directly configurable_product_options and configurable_product_links in the update of the model JSON body and in this case it has worked fine, although this way is not valid since configurable_product_links requires us to inform the ids of the products, which makes it unfeasible for bulk use, but gives us a hint that it may be necessary to report both somehow at the same time.
Does anyone faced this issue and knows if there is any solution or workaround?
Best regards!
Steps to reproduce
Create product options through POST /async/bulk/V1/configurable-products/bySku/options.
Link simple product to configurables through POST /async/bulk/V1/configurable-products/bySku/child.
Expected result
Product options are created successfully.
Actual result
Configurable product options is created but options values array is empty:
"extension_attributes": {
"configurable_product_options": [
{
"id": 27297,
"attribute_id": "684",
"label": "Color",
"position": 0,
"values": [],
"product_id": 47435
}
]
}
So when trying to link simples to configurables an error ocurrs:
{
"operations_list": [
{
"id": 0,
"status": 3,
"result_message": "The parent product doesn't have configurable product options.",
"error_code": 0
}
],
"user_type": 1,
"bulk_id": "bb4a73f0-695b-44d9-b286-00e9fba64cf1",
"description": "Topic async.magento.configurableproduct.api.linkmanagementinterface.addchild.post",
"start_time": "2023-07-18 13:53:35",
"user_id": 2,
"operation_count": 1
}
Additional information
No response
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Activity
m2-assistant commentedon Jul 18, 2023
Hi @goksasa. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
goksasa commentedon Jul 19, 2023
@magento give me 2.4-develop instance
magento-deployment-service commentedon Jul 19, 2023
Hi @goksasa. Thank you for your request. I'm working on Magento instance for you.
magento-deployment-service commentedon Jul 19, 2023
Hi @goksasa, here is your Magento Instance: https://2d17bd33bed233f5a0cbe12408d35f5b.instances-prod.magento-community.engineering
Admin access: https://2d17bd33bed233f5a0cbe12408d35f5b.instances-prod.magento-community.engineering/admin_a2a7
Login: a43728bc
Password: 765b05aad175
goksasa commentedon Jul 19, 2023
Hi there,
I could reproduce the error I am talking about in this new instance.
Steps I followed (same as in the official guide Create a configurable product tutorial
Problems appear in Step 4. Define configurable product options
https://2d17bd33bed233f5a0cbe12408d35f5b.instances-prod.magento-community.engineering/rest/default/V1/configurable-products/TH352N006-F11/options
has been made with the following body:After successful call, result has empty array for attribute extension_attributes > configurable_product_options > values.
Expected result is an array with Yellow colour option (value_index: 60).
Result JSON:
Exptected result:
This situation blocks linking simples to configurables.
For giving access to Magento API, a new Integration has been created, you can check API Access Tokens and Secrets in the Integrations section. Tests have been done with Postman.
Best regards!
goksasa commentedon Jul 19, 2023
Here are full JSONs.
expected_result.txt
result.txt
goksasa commentedon Jul 21, 2023
Hello,
Error was reproduced in newly created Magento instancia.
Could you let us the next steps?
Best regards!
m2-assistant commentedon Jul 21, 2023
Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.- If the issue is reproducible on
2.4-develop
branch, please, add the labelReproduced on 2.4.x
.- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
Issue: Confirmed
once verification is complete.goksasa commentedon Jul 21, 2023
Hello @engcom-Bravo ,
We could reproduce the error in the instance, and you have got all details in the thread about how to reproduce the error.
Reproduced on 2.4.x
Issue: Confirmed
Best regards!
engcom-Bravo commentedon Jul 24, 2023
@magento give me 2.4-develop instance
magento-deployment-service commentedon Jul 24, 2023
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
magento-deployment-service commentedon Jul 24, 2023
Hi @engcom-Bravo, here is your Magento Instance: https://2d17bd33bed233f5a0cbe12408d35f5b.instances-prod.magento-community.engineering
Admin access: https://2d17bd33bed233f5a0cbe12408d35f5b.instances-prod.magento-community.engineering/admin_07a3
Login: 52d79221
Password: cd8d1f0955b0
30 remaining items