You are here

README.txt in Extra Fields Checkout Pane 7

Same filename and directory in other branches
  1. 6.2 README.txt
uc_extra_fields_pane module
------------------------
by blackice78, MegaChriz and panthar

This modules allows an administrator to define additional (billing and
shipping) address fields (i.e. VAT) in Ubercart e-commerce suite. These
fields will be available during checkout process and in order handling
pages.

With this module an administrator has a flexible way to define one or
more address fields at
/admin/store/settings/countries/fields

These fields will appear to customers during the checkout process and
will be saved at the end of this process on a separate database table for
later use.
The additional address fields will appear in the original delivery
and billing pane, provided by Ubercart.

DEPENDENCIES
------------
This module requires Ubercart 7.x-3.2 or higher.

INSTALLATION
------------
  * Copy the module's directory to your modules directory
    and activate it.
  * Go to /admin/store/settings/countries/fields
    for defining extra address fields

The module will add two tables: uc_extra_fields and uc_extra_fields_values.

ABOUT THE FIELD TYPES
------------
  * Textfield
    This field type adds a simple text field to the form. This field can
    be pre-filled with a default value.
  * Select list
    This field type adds a selection field to the form (users can select a
    value from a dropdown menu). In the value section you can define the
    available options in the format "safe_key|readable part". The
    *safe_key* part is the part that will be saved in the database. The
    *readable* part is what will be presented to the user. IMPORTANT NOTE:
    if you want to make this field required, make sure that the first
    option of the list has an *empty* safe key.
    You can insert an empty safe key by typing a space.
    Example:
     |Please select
    option1|Option 1
    option2|Option 2
  * Checkbox
    This field type adds a checkbox to the form.
  * Constant
    This field type adds a value to the form which can not be changed
    by the customer. It is just displayed as plain text. However, admins
    who can change the Ubercart order are able to adjust the value of this
    field, because then it's displayed as a text field.
  * PHP string
    This field type is similar to the constant field type. The difference
    is that the shown value can be defined with PHP code, which means you
    could get this value from everywhere. In the value section you should
    return a string, for example:
    <?php return "A string"; ?>
  * PHP select list
    This field type is similar to the select list field type. The
    difference is that you can build the option list with PHP. Be sure to
    return an array with 'key' => 'value'.
    IMPORTANT NOTE: if you want to make this field required, make sure
    that the first option has an *empty* key. This may be a space, but it
    can also be an empty string.
    Example:
    <?php
      return array(
        '' => 'Please select',
        'option1' => 'Option 1',
        'option2' => 'Option 2',
      );
    ?>

DISPLAYING FIELDS IN INVOICE TEMPLATE
------------
By default, the field's values are not displayed in the invoice that gets
send by Ubercart. To let values of extra fields show up in the customer
invoice mail, you need to copy the customer invoice template to your theme
and then edit it to add the extra fields variables in there.
For the 7.x-1.x version of Extra Fields Pane, each field variable uses the
following pattern:
$uc_addresses_(address type)_(field name)
- '(address_type)' can be 'shipping' or 'billing'.
- '(field name)' is the machine name of your field, for example
  'ucxf_gender'.
So, if for example your extra field is called 'gender', then these
variables would be available for the Ubercart invoice template:
- $uc_addresses_shipping_ucxf_gender;
- $uc_addresses_billing_ucxf_gender;

Steps:
1. Copy the template 'uc-order--customer.tpl.php' to your theme (the
   template can be found in ubercart/uc_order/templates).
2. Edit the template uc-order--customer.tpl.php, add variables of extra
   fields to it (i.e. $uc_addresses_shipping_ucxf_gender).

See also http://drupal.org/node/1861720

VIEWS INTEGRATION
------------
Extra field values can be added to Ubercart Order based views and to
Ubercart Addresses based views.

MAINTAINERS
------------
MegaChriz
blackice78
panthar

File

README.txt
View source
  1. uc_extra_fields_pane module
  2. ------------------------
  3. by blackice78, MegaChriz and panthar
  4. This modules allows an administrator to define additional (billing and
  5. shipping) address fields (i.e. VAT) in Ubercart e-commerce suite. These
  6. fields will be available during checkout process and in order handling
  7. pages.
  8. With this module an administrator has a flexible way to define one or
  9. more address fields at
  10. /admin/store/settings/countries/fields
  11. These fields will appear to customers during the checkout process and
  12. will be saved at the end of this process on a separate database table for
  13. later use.
  14. The additional address fields will appear in the original delivery
  15. and billing pane, provided by Ubercart.
  16. DEPENDENCIES
  17. ------------
  18. This module requires Ubercart 7.x-3.2 or higher.
  19. INSTALLATION
  20. ------------
  21. * Copy the module's directory to your modules directory
  22. and activate it.
  23. * Go to /admin/store/settings/countries/fields
  24. for defining extra address fields
  25. The module will add two tables: uc_extra_fields and uc_extra_fields_values.
  26. ABOUT THE FIELD TYPES
  27. ------------
  28. * Textfield
  29. This field type adds a simple text field to the form. This field can
  30. be pre-filled with a default value.
  31. * Select list
  32. This field type adds a selection field to the form (users can select a
  33. value from a dropdown menu). In the value section you can define the
  34. available options in the format "safe_key|readable part". The
  35. *safe_key* part is the part that will be saved in the database. The
  36. *readable* part is what will be presented to the user. IMPORTANT NOTE:
  37. if you want to make this field required, make sure that the first
  38. option of the list has an *empty* safe key.
  39. You can insert an empty safe key by typing a space.
  40. Example:
  41. |Please select
  42. option1|Option 1
  43. option2|Option 2
  44. * Checkbox
  45. This field type adds a checkbox to the form.
  46. * Constant
  47. This field type adds a value to the form which can not be changed
  48. by the customer. It is just displayed as plain text. However, admins
  49. who can change the Ubercart order are able to adjust the value of this
  50. field, because then it's displayed as a text field.
  51. * PHP string
  52. This field type is similar to the constant field type. The difference
  53. is that the shown value can be defined with PHP code, which means you
  54. could get this value from everywhere. In the value section you should
  55. return a string, for example:
  56. * PHP select list
  57. This field type is similar to the select list field type. The
  58. difference is that you can build the option list with PHP. Be sure to
  59. return an array with 'key' => 'value'.
  60. IMPORTANT NOTE: if you want to make this field required, make sure
  61. that the first option has an *empty* key. This may be a space, but it
  62. can also be an empty string.
  63. Example:
  64. return array(
  65. '' => 'Please select',
  66. 'option1' => 'Option 1',
  67. 'option2' => 'Option 2',
  68. );
  69. ?>
  70. DISPLAYING FIELDS IN INVOICE TEMPLATE
  71. ------------
  72. By default, the field's values are not displayed in the invoice that gets
  73. send by Ubercart. To let values of extra fields show up in the customer
  74. invoice mail, you need to copy the customer invoice template to your theme
  75. and then edit it to add the extra fields variables in there.
  76. For the 7.x-1.x version of Extra Fields Pane, each field variable uses the
  77. following pattern:
  78. $uc_addresses_(address type)_(field name)
  79. - '(address_type)' can be 'shipping' or 'billing'.
  80. - '(field name)' is the machine name of your field, for example
  81. 'ucxf_gender'.
  82. So, if for example your extra field is called 'gender', then these
  83. variables would be available for the Ubercart invoice template:
  84. - $uc_addresses_shipping_ucxf_gender;
  85. - $uc_addresses_billing_ucxf_gender;
  86. Steps:
  87. 1. Copy the template 'uc-order--customer.tpl.php' to your theme (the
  88. template can be found in ubercart/uc_order/templates).
  89. 2. Edit the template uc-order--customer.tpl.php, add variables of extra
  90. fields to it (i.e. $uc_addresses_shipping_ucxf_gender).
  91. See also http://drupal.org/node/1861720
  92. VIEWS INTEGRATION
  93. ------------
  94. Extra field values can be added to Ubercart Order based views and to
  95. Ubercart Addresses based views.
  96. MAINTAINERS
  97. ------------
  98. MegaChriz
  99. blackice78
  100. panthar