Clean and tidy way to extend entity without messing with source?

Saturday, April 20, 2024 12:43:35 PM
  • Posted: Thursday, June 25, 2020 6:25 PM
  • 3
Hi,

Here's my problem:
let's say we want to add a custom string field "Deposit" in admin>customer>edit page, that would not allow activating customer when "Deposit" input field is empty.
What would be the cleanest approach to have this new field added to customer entity, and getting it saved to database? (Using only new plugin)
I assume I would have to override customer service, but get stuck with restricting myself from changing controller.
Also, what about extending customerViewModel?

Thank you in advance.
1
  • Posted: Friday, June 26, 2020 8:28 AM
  • 953
Hello Povilas,

The easiest and cleanest way will be using the GenericAttributes. You should figure out how to do it if you check the rest of the fields on the customer.
Best regards,
Patryk

GrandNode Team
1
  • Posted: Tuesday, July 7, 2020 7:42 AM
  • 3
Thanks Patryk!

And if there's a need to add these attributes programmatically, and have them as "migrations" without adding them manually over admin UI,
how can we resolve that?
0
  • Posted: Thursday, July 9, 2020 12:10 PM
  • 953
I suppose that you can do it with the plugin, however, I'm not a developer ;)
Best regards,
Patryk

GrandNode Team
0
back to top
Filters