public function thisProductHasCheckboxAttributeWithValue(ProductInterface $product, $productAttributeType, $productAttributeName, $value) { $attribute = $this->createProductAttribute($productAttributeType, $productAttributeName); $booleanValue = 'Yes' === $value; $attributeValue = $this->createProductAttributeValue($booleanValue, $attribute); $product->addAttribute($attributeValue); $this->objectManager->flush(); }