Skip to content

Undefined value sets in the variant's sku #36309

@Dhaval410

Description

@Dhaval410

Preconditions and environment

  • Magento version: 2.4.5
  • Add sample data by using this command bin/magento sampledata:deploy

Steps to reproduce

  1. Go to the Stores menu -> select 'Attribute set' under the Attributes section.

  2. Select any one attribute set from the list and it will open.

  3. Move any group to the top above the 'Product Details' group in the group section like in the below image.
    Bag-Attribute-Sets-Attributes-Stores-Magento-Admin

  4. Open any product from that attribute set in which you move the group (In my case I have taken one product as marked in the below image where the attribute set is 'Bag').
    Products-Inventory-Catalog-Magento-Admin

  5. Now go to the 'Configurations' tab and create a simple product by clicking the 'Create Configurations' as in the below image.
    Joust-Duffle-Bag-Products-Inventory-Catalog-Magento-Admin

  6. Now follow the steps mentioned below:

  • Step 1: Select Attributes - select any attribute from the list and click next.
  • Step 2: Attribute Values - Select options and click on the next.
  • Step 3: Bulk Images, Price, and Quantity - Don't do anything and click on the next.
  • Step 4: Summary - you can see the grid of the products you are about to create. But in the 'SKU' column, you can see it sets the undefined text instead of the parent SKU's text as in the below image.

Variant-Products-Inventory-Catalog-Magento-Admin

Expected result

when we create variants of the product while the other tab is on the top above the 'Product Details', it should create variants with the proper SKU names like in the image.
Correct-Variant-Products-Inventory-Catalog-Magento-Admin

Actual result

It sets the undefined value to the SKU as shown in step 6 of Steps to reproduce.

Additional information

As I checked the file -

/vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/summary.js

in this file, there is a function name 'calculate()' at line 93 as in image.

summary-file-calculate

In this function getting productSku by calling function getProductValue() with passing argument 'sku'. This function is defined in the file -

/vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/variations.js

at line 132 as in the image.

variation-file-getProductValue

in the getProductValue() function, there is a code to get the value of the SKU at line 135. Here, if the 'Product Details' tab is not open by default in the product edit page in the admin then it can't able to get the value for the SKU. Because if the 'Product Details' tab is not opened then their elements don't load.

By default, the first tab will be open. So, if we add another tab to the top above the 'Product Details' tab then this tab will collapse (not open) by default. And the elements of this tab will not load. And we will get the undefined text instead of the proper SKU name for the variants. The same thing happens with the product name also.

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”.

Metadata

Metadata

Assignees

Labels

Area: ProductComponent: ConfigurableProductIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReported on 2.4.5Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions