0

I am using datapatch to update attribute my code is

 namespace Devall\SpecialPrice\Setup\Patch\Data;

 use Magento\Framework\Setup\Patch\DataPatchInterface;
 use Magento\Eav\Setup\EavSetup;

class AddLabaCenaAttribute implements DataPatchInterface

protected $eavSetupFactory;

public function __construct(EavSetup $eavSetupFactory)
{
    $this->eavSetupFactory = $eavSetupFactory;
}

/**
 * @inheritDoc
 */
public static function getDependencies()
{
    return [];
}

/**
 * @inheritDoc
 */
public function getAliases()
{
    return [];
}

/**
 * @inheritDoc
 */
public function apply()
{
    $this->eavSetupFactory->updateAttribute(4, 184, 'is_used_for_promo_rules', 1);
}
}

1 Answer 1

0

I was using wrong ID (not entitytypeid,true ID) so It was thinking entitytypeid was wrong.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.