shopp('customer.shipping-state')

Displays the customer shipping state/province drop-down input field, populated with the currently stored shipping state.

shopp('customer', 'shipping-state', 'options')

@param string $object the object or object.tag combination, if object.tag is used, the tag parameter can be omitted
@param string $tag the tag, can be hyphenated or not. Prefix with 'get' as shorthand for the return=true option
@param mixed $options associative array, or url-style name=value pairs separated by ampersands (&). Each pair is passed to the theme api tag as an option.
@returns void by default, shipping state drop-down menu or input field string if return option is used.

Alternative Forms

shopp('customer.shipping-state', 'options');

Description

Displays the customer shipping state/province drop-down input field, populated with the currently stored shipping state.

If the currently selected country has states/provinces, this function will display a drop-down menu of state/provinces.

Universal Options

All Theme API calls have these options.

  • return: when set to true, 1, or on, this option forces the tag to return the value instead of displaying/echoing the value to the page. Alternatively, prefix the tag parameter with get to get the same effect. All theme api tags that return a boolean value will return by default.
  • echo: when set to false, 0, or off, this option forces the tag to display the value to the page. This is the default for all non-boolean tags.
  • is: when set to true, 1, or on, this option will evaluate the return of the theme api call as a boolean true or false value. See how values are converted to boolean.

Default Drop-Down Options

These options are used on theme api calls that output form input tags, to specify attributes.

  • class: option for the class input attribute. The option’s value added to the class attribute.
  • disabled: option for the disabled input attribute. Outputs a ‘disabled’ class and attribute if option is set to ‘true’,’on’,’1′.
  • required: option for the required input attribute. Output a ‘required’ class if option is set to ‘true’,’on’,’1′.
  • accesskey: option for the accesskey input attribute. The option’s value is output as the attribute.
  • size: option for the size input attribute. The option’s value is output as the attribute.
  • tabindex: option for the tabindex input attribute. The option’s value is output as the attribute.
  • title: option for the title input attribute. The option’s value is output as the attribute.

Options

The following options are valid.

  • mode: (default null) set to mode=value to display the current shipping state stored for the customer.
  • selected: (defaults to the base state) set to a two-letter state code to set the current state in the option menu.
  • type: (defaults to menu) will display a drop-down menu when type=menu or the type option is not set, otherwise it will display a text input.
  • value: (defaults to saved state) if type=text and there is no saved state/province for the customer, this option can be used to display a default value.

Examples

// display the current customer's shipping state drop-down menu
shopp('customer.shipping-state');
// display the current customer's shipping state drop-down menu
// set Ohio as the selected state
shopp('customer.shipping-state','selected=OH);
// display the current customer's shipping state input field
shopp('customer.shipping-state','type=input');
// display the current customer's shipping state input field
// set the default value to OH
shopp('customer.shipping-state','type=input&value=OH');
// display the current customer's shipping state
shopp('customer.shipping-state','mode=value');
// get the current customer's shipping state
$state = shopp('customer.get-shipping-state','mode=value');

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar