I can update products efficiently without loading the whole product with

$this->productAction->updateAttributes([$productId], $attributesData, 0);

where $attributesData is an array, e.g. ['fabric' => 'cotton', 'pattern_repeat' => '50'].

However I would like to delete attribute values too, without setting them to empty values, so actually deleted and not set to null.

There is no method in Magento\Catalog\Model\Product\Action for deleting an attribute value for a product, just setting or updating what is there.

How can I delete a product attribute option value without loading the whole product?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.