Skip to content

Can not change product status which product created with productRepository #5664

@cizgidekiadam

Description

@cizgidekiadam

Preconditions

  • Any supported Magento version

Steps to reproduce

$product = $objectManager->create(Product::class); $product->setTypeId(Type::TYPE_SIMPLE) ->setWebsiteIds([1]) ->setName(NAME) ->setSku(SKU) ->setPrice(10) ->setVisibility(Visibility::VISIBILITY_BOTH) ->setStatus(Status::STATUS_DISABLED) ->setCategoryIds(array(1,5,7)); try { $product = $productRepository->save($product); } catch (\Exception $e) { echo $e->getMessage(); }
Product created successfully.
In admin set 'Enable Product' true. But at product grid in admin, status seems 'Disabled'.

Expected result

Product have to be online in website

Actual result

'We can't find products matching the selection.'
And product status seen Disabled in admin grid.

Metadata

Metadata

Assignees

Labels

Component: CatalogIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions