Timeline for Add Attribute to All Magento Customers, preferably an Object
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 8, 2016 at 23:30 | comment | added | CodingMageSheen | haha okay well I wanted to stay away from mySQL queries I know the other ways of updating them so no worries :)! What would happen hypothetically if I deleted my Sean Directory and everything in it along with the Sean_CustomerAddCustomAttr.xml module? Would the customers still retain their new attributes? | |
| Jun 8, 2016 at 23:03 | comment | added | Fabian Schmengler | Well, there is a "default" field for attributes, but it does not work with EAV models like the customer, at least it does not create values for existing customers. I would do this with an SQL query like insert into customer_entity_int (entity_id,attribute_id,value) select entity_id, 666, 0 from customer_entity. Replace 666 with the id of the attribute that you found in eav_attributes. You can execute the query in your install script with $this->run($query). Warning: I wrote that one from the top of my head, test it first! | |
| Jun 8, 2016 at 22:58 | comment | added | CodingMageSheen | Thank You. I've literally been spending all week trying to get this to work and you helped in so many ways :). Quick question though, instead of having to set the values to something other than NULL is there a way I could just preset them all to "0" in the install script? | |
| Jun 8, 2016 at 22:36 | history | answered | Fabian Schmengler | CC BY-SA 3.0 |