You are here

README.txt in Extra Fields Checkout Pane 6.2

Same filename and directory in other branches
  1. 7 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) as well as custom order fields 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/checkout/edit/fields
and custom order fields at
/admin/store/settings/checkout/edit/extrafields

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. Custom order fields will appear
in it's own checkout pane.

DEPENDENCIES
------------
This module requires Ubercart 2.3 or higher.

INSTALLATION
------------
  * Copy the module's directory to your modules directory
    and activate it.
  * Go to /admin/store/settings/checkout/edit/fields
    for defining extra address fields
    or to /admin/store/settings/checkout/edit/extrafields
    for defining custom order 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. Note: setting this field
    to required has no effect, because of a core bug in Drupal. The module
    "Checkbox Validate" corrects this bug.
  * 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 6.x-2.x version of Extra Fields Pane, each field variable uses the
following pattern:
$extra_(pane_type)_(field name)
- '(pane_type)' can be 'extra_delivery', 'extra_billing' or
  'extra_information'.
- '(field name)' is the machine name of your field without the 'ucxf_'
  prefix, for example 'gender'.

So, if you have an address field that's called 'gender', then these
variables will be available for the Ubercart invoice template:
- $extra_extra_delivery_gender;
- $extra_extra_billing_gender;
And if you have a custom field that's called 'your_reference', then this
variable will be available for the Ubercart invoice template:
- $extra_extra_information_your_reference;

Steps:
1. Copy templates uc_order-customer.tpl.php and uc_order.tpl.php to your
   theme (the templates 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. $extra_extra_delivery_gender).

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

UBERCART ADDRESSES INTEGRATION
------------
Extra Fields Pane integrates best with the 6.x-2.x version of Ubercart
Addresses (6.x-2.0-alpha1 or later). As the code of Ubercart Addresses is
not stable yet, this version of Extra Fields Pane could be incompatible
with future versions of Ubercart Addresses 6.x-2.x.

This version of Extra Fields Pane also contains integration code for
Ubercart Addresses 6.x-1.x, but this is not a full integration.

VIEWS INTEGRATION
------------
If you want to use this module in combination with Views, you will need
to install the Ubercart Views module:
http://drupal.org/project/uc_views
For views based on Ubercart orders, activate the module 'Ubercart Views'.
For views based on Ubercart Addresses 6.x-1.x, activate the module
'uc_views_addresses'. DO NOT enable that module if used in combination with
Ubercart Addresses 6.x-2.0-alpha2 or later, because Ubercart Addresses has
it's own Views implementation since 6.x-2.0-alpha2.

MAINTAINERS
------------
blackice78
MegaChriz
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) as well as custom order fields in
  6. Ubercart e-commerce suite. These fields will be available during checkout
  7. process and in order handling pages.
  8. With this module an administrator has a flexible way to define one or
  9. more address fields at
  10. /admin/store/settings/checkout/edit/fields
  11. and custom order fields at
  12. /admin/store/settings/checkout/edit/extrafields
  13. These fields will appear to customers during the checkout process and
  14. will be saved at the end of this process on a separate database table for
  15. later use.
  16. The additional address fields will appear in the original delivery
  17. and billing pane, provided by Ubercart. Custom order fields will appear
  18. in it's own checkout pane.
  19. DEPENDENCIES
  20. ------------
  21. This module requires Ubercart 2.3 or higher.
  22. INSTALLATION
  23. ------------
  24. * Copy the module's directory to your modules directory
  25. and activate it.
  26. * Go to /admin/store/settings/checkout/edit/fields
  27. for defining extra address fields
  28. or to /admin/store/settings/checkout/edit/extrafields
  29. for defining custom order fields.
  30. The module will add two tables: uc_extra_fields and uc_extra_fields_values.
  31. ABOUT THE FIELD TYPES
  32. ------------
  33. * Textfield
  34. This field type adds a simple text field to the form. This field can
  35. be pre-filled with a default value.
  36. * Select list
  37. This field type adds a selection field to the form (users can select a
  38. value from a dropdown menu). In the value section you can define the
  39. available options in the format "safe_key|readable part". The
  40. *safe_key* part is the part that will be saved in the database. The
  41. *readable* part is what will be presented to the user. IMPORTANT NOTE:
  42. if you want to make this field required, make sure that the first
  43. option of the list has an *empty* safe key.
  44. You can insert an empty safe key by typing a space.
  45. Example:
  46. |Please select
  47. option1|Option 1
  48. option2|Option 2
  49. * Checkbox
  50. This field type adds a checkbox to the form. Note: setting this field
  51. to required has no effect, because of a core bug in Drupal. The module
  52. "Checkbox Validate" corrects this bug.
  53. * Constant
  54. This field type adds a value to the form which can not be changed
  55. by the customer. It is just displayed as plain text. However, admins
  56. who can change the Ubercart order are able to adjust the value of this
  57. field, because then it's displayed as a text field.
  58. * PHP string
  59. This field type is similar to the constant field type. The difference
  60. is that the shown value can be defined with PHP code, which means you
  61. could get this value from everywhere. In the value section you should
  62. return a string, for example:
  63. * PHP select list
  64. This field type is similar to the select list field type. The
  65. difference is that you can build the option list with PHP. Be sure to
  66. return an array with 'key' => 'value'.
  67. IMPORTANT NOTE: if you want to make this field required, make sure
  68. that the first option has an *empty* key. This may be a space, but it
  69. can also be an empty string.
  70. Example:
  71. return array(
  72. '' => 'Please select',
  73. 'option1' => 'Option 1',
  74. 'option2' => 'Option 2',
  75. );
  76. ?>
  77. DISPLAYING FIELDS IN INVOICE TEMPLATE
  78. ------------
  79. By default, the field's values are not displayed in the invoice that gets
  80. send by Ubercart. To let values of extra fields show up in the customer
  81. invoice mail, you need to copy the customer invoice template to your theme
  82. and then edit it to add the extra fields variables in there.
  83. For the 6.x-2.x version of Extra Fields Pane, each field variable uses the
  84. following pattern:
  85. $extra_(pane_type)_(field name)
  86. - '(pane_type)' can be 'extra_delivery', 'extra_billing' or
  87. 'extra_information'.
  88. - '(field name)' is the machine name of your field without the 'ucxf_'
  89. prefix, for example 'gender'.
  90. So, if you have an address field that's called 'gender', then these
  91. variables will be available for the Ubercart invoice template:
  92. - $extra_extra_delivery_gender;
  93. - $extra_extra_billing_gender;
  94. And if you have a custom field that's called 'your_reference', then this
  95. variable will be available for the Ubercart invoice template:
  96. - $extra_extra_information_your_reference;
  97. Steps:
  98. 1. Copy templates uc_order-customer.tpl.php and uc_order.tpl.php to your
  99. theme (the templates can be found in ubercart/uc_order/templates).
  100. 2. Edit the template uc_order-customer.tpl.php, add variables of extra
  101. fields to it (i.e. $extra_extra_delivery_gender).
  102. See also http://drupal.org/node/1861720
  103. UBERCART ADDRESSES INTEGRATION
  104. ------------
  105. Extra Fields Pane integrates best with the 6.x-2.x version of Ubercart
  106. Addresses (6.x-2.0-alpha1 or later). As the code of Ubercart Addresses is
  107. not stable yet, this version of Extra Fields Pane could be incompatible
  108. with future versions of Ubercart Addresses 6.x-2.x.
  109. This version of Extra Fields Pane also contains integration code for
  110. Ubercart Addresses 6.x-1.x, but this is not a full integration.
  111. VIEWS INTEGRATION
  112. ------------
  113. If you want to use this module in combination with Views, you will need
  114. to install the Ubercart Views module:
  115. http://drupal.org/project/uc_views
  116. For views based on Ubercart orders, activate the module 'Ubercart Views'.
  117. For views based on Ubercart Addresses 6.x-1.x, activate the module
  118. 'uc_views_addresses'. DO NOT enable that module if used in combination with
  119. Ubercart Addresses 6.x-2.0-alpha2 or later, because Ubercart Addresses has
  120. it's own Views implementation since 6.x-2.0-alpha2.
  121. MAINTAINERS
  122. ------------
  123. blackice78
  124. MegaChriz
  125. panthar