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

Created on 13 Feb 2017  路  3Comments  路  Source: magento/magento2

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.

Clear Description Format is valid

Most helpful comment

Again: I know the correct way to save the product. I just want to let other people know about this behaviour so they can get their issue resolved, since the first place will be the issue tracker of this github repository.

All 3 comments

@PascalBrouwers, please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this issue. The GitHub issue tracker is intended for Magento Core technical issues only.

Again: I know the correct way to save the product. I just want to let other people know about this behaviour so they can get their issue resolved, since the first place will be the issue tracker of this github repository.

Thanks a lot! I have no idea for this problem already for a long long time.

Again: I know the correct way to save the product. I just want to let other people know about this behaviour so they can get their issue resolved, since the first place will be the issue tracker of this github repository.

Was this page helpful?
0 / 5 - 0 ratings