We will need all commerce customers to have a phone number field, since we use that for lookup in addition to email. I think this is just a field added to the user, but we may want to check how addresses are done.

Comments

smccabe created an issue. See original summary.

TylerMarshall’s picture

Status: Active » Needs work
StatusFileSize
new1.41 KB

This patch adds a phone number field to the user via the configuration in commerce_pos. Still needs to be exposed to user and probably some sort of schema file?

subhojit777’s picture

+++ b/config/install/field.field.user.user.commerce_pos_phone_number.yml
@@ -0,0 +1,21 @@
+uuid: 25905bbe-b4fd-4493-97c0-804769288c42

UUIDs are instance specific, and they should not get into yml files inside config/install

+++ b/config/install/field.field.user.user.commerce_pos_phone_number.yml
@@ -0,0 +1,21 @@
+field_type: telephone

Since this field type is already provided by the core, you don't need to provide a schema for this. Still, if you want to make sure that everything is okay, you can use https://www.drupal.org/project/config_inspector

Drupal Commerce Payment also creates user fields, you can refer the code

TylerMarshall’s picture

StatusFileSize
new970 bytes
new1.43 KB

Adds telephone field in backend.

TylerMarshall’s picture

Status: Needs work » Needs review
TylerMarshall’s picture

StatusFileSize
new1.47 KB

Adds dependencies on commerce_pos module.

subhojit777’s picture

Status: Needs review » Needs work

nitpicks

  1. +++ b/config/install/field.field.user.user.commerce_pos_phone_number.yml
    @@ -0,0 +1,23 @@
    +_core:
    +  default_config_hash: XFwyb8J8K4f6pLeDbXxUaXk92FM3dO_C2-kbxJuyNhM
    

    hash codes are instance specific, and shouldn't be there when you are installing a config

  2. +++ b/config/install/field.field.user.user.commerce_pos_phone_number.yml
    @@ -0,0 +1,23 @@
    \ No newline at end of file
    

    Please add a new line

rakesh.gectcr’s picture

Status: Needs work » Needs review
StatusFileSize
new1.59 KB

Looks like straight forward one. Please review it.

subhojit777’s picture

Status: Needs review » Reviewed & tested by the community

Looks ok.

smccabe’s picture

Status: Reviewed & tested by the community » Fixed

Thanks guys, committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.