Skip to content

Doing a product save will set has_options to 0 because of check getCanSaveCustomOptions() in beforeSave and custom options disappear from frontend #8531

@PascalBrouwers

Description

@PascalBrouwers

Preconditions

  1. Magento 2.1.4

Steps to reproduce

  1. Have a simple product with custom options
  2. In code add some data with $product->addData()
  3. Save the product using it's own save function: $product->save()

Expected result

  1. Product should display it's custom options on frontend

Actual result

  1. Custom options are not shown on frontend because of attribute has_options is set to 0.

I know the correct way to save the product is: $this->productRepository->save($product) and this problem will not happen. I just want to let other people know about this behaviour so they can get their issue resolved.

Metadata

Metadata

Labels

Issue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions