Search code examples
sap-commerce-cloudspartacus-storefront

Spartacus: Override cx-update-profile to add/modify input fields in PersonalDetails


Am trying to modify Personal details page in myaccount, i want to add new input fields, remove some existing input fields, how to achieve this, appreciate your help. Thanks.


Solution

  • General way of replacing a CMS component

    • find the flexType of the component, or the component typecode from the /pages request in your browser tools - network tab.
    • generate a module and a component with the ng-cli (ng g m your-profile-details followed by ng g c your-profile-details
    • configure your component to be used https://sap.github.io/spartacus-docs/customizing-cms-components/#page-title
    • copy the entire HTML from the OOTB source code
    • in the *component.ts file, you extend the OOTB component extends XXComponent
    • sometimes you have to copy the implementation as well, depending on the visibility of the attributes / functions in the OOTB component.

    Run yarn run start and verify if your component is now in use!

    Modify your component HTML to your liking.