Announcement

Collapse
No announcement yet.

B2C mode and two addresses

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • B2C mode and two addresses

    Greetings.

    I'm new to EspoCRM, so i'm just learning how things done here.

    I've found man page about how to change EspoCRM from B2B mode to B2C mode: https://github.com/espocrm/documenta...tration/b2c.md
    And there is one problem for me. Accounts (which are organizations in B2B model as I understand) have two Address fields - Billing Address and Shipping Address.
    But Contacts (which are individual customers in B2C model) have only one Address.
    So, is it possible for Contacts to also have two Address fields - Billing Address and Shipping Address? And if it's possible - how to make it?

  • #2
    Hi

    You can add it: Administration > Entity Manager > Contact > Fields > Add Field > Address
    Name it "shippingAddress"

    Then put it on Detail Layout in Layout Manager.

    Comment


    • #3
      Cool.

      And how to get "Copy Billing" button here (in Contact) too?
      I see it in client/modules/crm/src/views/account/fields/shipping-address.js file, but simple copying it to client/modules/crm/src/views/contact/fields does nothing.

      Comment


      • #4
        In needs some manual customization.

        Comment


        • #5
          Seems logical.

          At least, which files need to be customized? EspoCRM's structure is still very complicated for me.

          Comment


          • #6
            look to
            application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account
            and Contact.

            There are custom view for shipping address. You can do the same for your new contact field (metadata in custom folder)

            Comment


            • #7
              It's working. Thank you.

              But there is another problem with it now:
              (It's B2C case)
              For example, when I create new Lead, it have "simple" Address.
              Next I'm converting this Lead to Contact (my "new" Contact now have two address fields - billingAddress and shippingAddress) and in result address information "stay" in "simple" Address fields.

              So now there are three different addresses in CRM: Address, billingAddress and shippingAddress. Kinda a lot of addresses. =)
              May be it will be logical to get rid of "simple" Address and replace it with billingAddress CRM-wide OOTB? (billingAddress is "basic" and shippingAddress is additional)

              Comment


              • #8
                This worked perfectly for Me! Except I was doing it to Opportunity and a Different Address Label of ServiceAddress.
                Now I put the file in the following directory: C:\xampp\htdocs\espocrm\client\modules\crm\src\vie ws\opportunity\fields\service-address.js

                Will an upgrade/update break this? Should it be in the custom directory somewhere?

                Comment


                • #9
                  https://www.espocrm.com/documentatio...nt-field-views

                  Comment


                  • khopper
                    khopper commented
                    Editing a comment
                    That part I got and its working fine in the metadata folder, C:\xampp\htdocs\espocrm\custom\Espo\Custom\Resourc es\metadata\entityDefs\Opportunity.json

                    I was asking about the new js file I created.
                    I don't see a location in the metadata folder to place the js file, or is it fine where its at? I copied the shipping-address.js file from: C:\xampp\htdocs\espocrm\client\modules\crm\src\vie ws\account\fields\shipping-address.js to create the "service-address.js" file and modified it of course.

                    C:\xampp\htdocs\espocrm\client\modules\crm\src\vie ws\opportunity\fields\service-address.js

                  • tanya
                    tanya commented
                    Editing a comment
                    if you look above on this page, you will see the path
                    if you set in entityDefs the view "custom:views/opportunity/fields/service-address" it has to be in client/custom/src/views/opportunity/fields/service-address.js
                    "custom: " read from client/custom/, src folder for js, res folder for templates. Other part of view is the same as the path to the file.
                Working...
                X