What are the Slack Archives?
Itโs a history of our time together in the Slack Community! Thereโs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonโt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hey, a quickie. I would like to add some fields to the `CustomerForm` in the Backoffice. I could do
Hey, a quickie. I would like to add some fields to the CustomerForm
in the Backoffice. I could do that by extending the CustomerForm
class and overriding the build method, and then overriding the factory, etc. However, I'm not sure how to handle the processing of the resulting DTO.
How to best do this? Is it actually possible to add fields to the CustomerForm
or is it better to just add my fields in another screen in BO? Any sort of guidance on what would be the best way to achieve my goal would be greatly appreciated. ๐
Comments
-
I've seen the
CustomerModel
has a plugin system. Is the case that I should tap into that?0 -
I would simply extend the
CustomerForm
on project level, overridebuildForm
and add my custom field(s) and add these fields to thespy_customer.schema.xml
andcustomer.transfer.xml
as well. should be it0 -
Yes, I can do that, but then how do I process the newly added fields in the transfer? For instance, one of those fields is
dietaryPreferences
, and I want to save those on a separate table.0 -
Why do you want to save that on a separate table? One of the benefits of Spryker is that you can extend already existing tables and do not need to query two tables because of an extension.
It might still be valid to use a separat table, then you will need to extend\Spryker\Zed\Customer\Business\Customer\Customer::update
in your project and implement a\Spryker\Zed\Customer\Dependency\Plugin\CustomerTransferExpanderPluginInterface
to add those new fields to theCustomerTransfer
so you are able to use it in Yves/Glue.0 -
Excellent. Thanks @UL6DGRULR!
Yes, I need a separate table because what I need to add to the customer is a collection of things.
0 -
I understand that is a new "entity" strictly speaking, but I was just wondering if I could extend the customer form because these are things closely related to the customer.
0 -
But I think my only option might be to create a new screen in BO to define those values. Seems simpler.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 927 Developer Corner
- 785 Spryker Development
- 88 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random