Skip to content

Multiple hyphens in sku when adding to cart #38518

Open
@RetroProgrammist

Description

@RetroProgrammist

Preconditions and environment

  • 2.4.6-2.4.7

Steps to reproduce

  1. Create a simple product
  2. add custom options either multiselect or checkbox with multiple values (3+)
  3. Go to the product page and add to cart by selecting 3 or more option values of multiselect / checkbox type.
  4. Check quote_item table sku column

Expected result

Product sku only

Actual result

Product sku with hyphens on end

Additional information

The problem can be solved by adding a check for null or empty value in the \Magento\Catalog\Model\Product\Option\Type\Select::getOptionSku method.
line 302

eg.
instead of it
$skus[] = $optionSku->getSku();
use

      if(!empty($optionSku->getSku())) {
          $skus[] = $optionSku->getSku();
      }

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: DBIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.4.6Indicates 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

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions