Day: February 9, 2017

magento 2

Update Customer Data in Magento2 with custom attribute

protected $_customerRepositoryInterface; public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface ) { parent::__construct($context); $this->resultPageFactory = $resultPageFactory; $this->_customerRepositoryInterface = customerRepositoryInterface; } Now execute function here reward_barcode is custom attribute: public function execute() { $customerId = 2; if ($customerId) { $customer...