Skip to content

Creating and Managing Custom Fields#


Custom fields in Miva Merchant provide a flexible way to store and manage additional information for products, categories, customers, orders, and pages. By creating and organizing custom fields effectively, you can extend Miva’s default capabilities and tailor your store to meet unique business requirements.


Creating Custom Fields#

Accessing the Custom Fields Section#

  1. Log in to your Miva Merchant admin interface.
  2. Navigate to Settings > Utilities.
  3. Select the Custom Fields tab.

Creating a New Custom Field#

  1. Click “New Custom Field”:
    • Open the Custom Fields tab and click the New Custom Field button.
  2. Configure Field Settings:
    • Type: Assign the field to a specific entity, such as products, categories, customers, orders, or pages.
    • Code: Enter a unique identifier for the field (e.g., product_material).
    • Name: Enter a user-friendly name (e.g., Material).
    • Field Type: Choose the appropriate type:
      • Text Field: For single-line text inputs.
      • Text Area: For multi-line text inputs.
      • Radio Button: For selecting a single option from multiple predefined choices.
      • Drop-Down List: For selecting a single option from a dropdown menu.
      • Checkbox: For binary yes/no or true/false options.
      • Image Upload: For uploading images via the admin (e.g., product diagrams, logos).
      • PDF Upload: For uploading PDF documents via the admin (e.g., manuals, datasheets).
      • Multi-Text: For storing multiple lines of text, such as a list of values.
    • Facet Checkbox: Enable this option to make the custom field available as a filterable facet on the frontend.
    • Public Checkbox: Enable this option to expose the custom field through the Miva JSON API.
    • Group Dropdown: Select an existing Custom Field Group to organize the field within the admin interface.
    • Additional Information: Add a description or tooltip to help administrators understand the purpose of the field when entering data.
  3. Save the Field:
    • Click Add to finalize the custom field configuration.

Assigning Custom Fields to Templates#

After creating custom fields, they can be assigned to the relevant templates for use within the template.

Steps:#

  1. Navigate to the User Interface > Templates section in the admin interface.
  2. Open the template for the desired page or layout.
  3. If there is a product list or display item the custom field can be added to the template by enabling the Custom Fields option in the settings (this can also be done manually by referencing the field in the template).

Example for Product Custom Field:

<p>Material: &mvt:product:customfield_values:customfields:material;</p>


Managing Custom Fields with Groups#

Organizing custom fields into groups simplifies data management and improves usability.

Creating Custom Field Groups:#

  1. Go to Settings > Utilities > Custom Field Groups.
  2. Click New Group and configure the following:
    • Code: A unique identifier for the group (e.g., specs).
    • Name: A descriptive name for the group (e.g., Product Specifications).
  3. Save the group.

Assigning Fields to Groups:#

  1. Open an existing custom field or create a new one.
  2. Select the desired group from the Group dropdown menu.
  3. Save the field to assign it to the group.

Benefits of Grouping:#

  • Streamlines data management by categorizing related fields.
  • Improves navigation in the admin interface, especially when managing many custom fields.
  • Enhances clarity for administrators entering data.

Practical Examples#

Example 1: Creating a Custom Product Field for Materials#

  1. Field Configuration:
    • Code: product_material
    • Name: Material
    • Type: Text Field
    • Entity: Product
  2. Assign to Template:
    • Assign the custom field to the display item
    • Add the following to the Product Display template:
      <p>Material: &mvt:product:customfield_values:customfields:product_material;</p>
      
  3. Usage:
    • When editing a product in the admin, a “Material” field will appear for data entry.

Example 2: Adding Custom Order Notes#

  1. Field Configuration:
    • Type: Order
    • Code: order_notes
    • Name: Order Notes
    • Field Type: Text Area
  2. Capture Notes During Checkout:
    • Add a text area to the checkout page (OSEL):
      <label for="order_notes">Order Notes:</label>
      <textarea name="order_notes" id="order_notes"></textarea>
      
  3. Store Notes in the Order Record:
    • Use the Write_Basket function on the OPAY page to capture and transfer the notes:
      <mvt:item name="customfields" param="Write_Basket( 'order_notes', g.order_notes )" />
      

Best Practices#

  1. Use Descriptive Codes:

    • Ensure custom field codes are intuitive and clearly describe their purpose.
    • Example: Use product_warranty instead of pw.
  2. Organize with Groups:

    • Group related fields (e.g., Specifications, Customer Details) to streamline management.
  3. Document Field Usage:

    • Maintain a record of custom fields, their purposes, and associated templates for easy reference.
  4. Test in Branches:

    • Use Miva’s branching feature to test custom field configurations in a sandbox environment.
  5. Leverage Default Values:

    • Set default values for fields that are frequently reused to save time during data entry.

Summary#

Creating and managing custom fields in Miva Merchant allows you to enhance your store’s data structure and tailor its functionality to meet your unique business needs. By following this guide, you can effectively create, assign, and organize custom fields, ensuring a seamless integration with your store’s templates.

Explore Custom Field Groups → to learn how to organize and manage custom fields efficiently.