Function __global->get_address_fields

Definitions

sources/ecommerce.php

  • Get form fields for an address.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$prefix string No No required parameter N/A N/A The prefix for the address input field
$street_address string No No required parameter N/A N/A Street address
$city string No No required parameter N/A N/A Town/City
$county string No No required parameter N/A N/A County
$state string No No required parameter N/A N/A State
$post_code string No No required parameter N/A N/A Postcode/Zip
$country string No No required parameter N/A N/A Country
$require_all_details boolean No No True N/A N/A Whether to require all details to be input

Returns

  • A pair: Address fields, Address hidden fields
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get form fields for an address.
 *
 * @param  string $prefix The prefix for the address input field
 * @param  string $street_address Street address
 * @param  string $city Town/City
 * @param  string $county County
 * @param  string $state State
 * @param  string $post_code Postcode/Zip
 * @param  string $country Country
 * @param  boolean $require_all_details Whether to require all details to be input
 * @return array A pair: Address fields, Address hidden fields
 */

function get_address_fields(string $prefix, string $street_address, string $city, string $county, string $state, string $post_code, string $country, bool $require_all_details = true) : array