shopp('customer.marketing')

Displays the marketing opt-in/opt-out checkbox input for the customer profile.

shopp('customer', 'marketing', '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, the marketing opt-in/opt-out checkbox markup when return option is used.

Alternative Forms

shopp('customer.marketing', 'options');

Description

Displays the marketing opt-in/opt-out checkbox input for the customer profile.

This will allow your customer to modify their marketing preference, such as whether or not they wish to receive email marketing from your organization. This theme api function should be used on your customer profile form.

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.

Form Input Options

These options are used to specify form input attributes on the marketing checkbox.

  • class: option for the class input attribute. The option’s value added to the class attribute.
  • format: option for the format input attribute. The option’s value is output as the attribute.
  • disabled: option for the disabled input attribute. Outputs a ‘disabled’ class and attribute if option is set to ‘true’,’on’,’1′.
  • minlength: option for the minlength input attribute. The option’s numeric value is output a class. (ie. min1)
  • maxlength: option for the maxlength input attribute. The option’s numeric value is output a class. (ie. max1)
  • readonly: option for the readonly input attribute. Outputs a ‘readonly’ class and attribute if option is set to ‘true’,’on’,’1′.
  • accesskey: option for the accesskey input attribute. The option’s value is output as the attribute.
  • alt: option for the alt input attribute. The option’s value is output as the attribute.
  • checked: option for the checked input attribute. Output if option is set to ‘true’,’on’,’1′.
  • size: option for the size input attribute. The option’s value is output as the attribute.
  • src: option for the src 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: Set to mode=value to output only the current value stored for this field.
  • checked: (Not set by default) Used to set the default value for this checkbox input if there is no setting, or if the setting is turned off. Set checked=on to pre-check this field (still allows them to uncheck the box) when the customer has not selected a marketing preference.

Examples

// output marketing checkbox
shopp('customer.marketing');
// set marketing to true if customer has opted-in, false if they have opted out
$marketing = str_true(shopp('customer.get-marketing','mode=value'));
if ( $marketing ) echo "You have opted-in to email marketing from us."
else echo "You have opted-out from email marketing."

See Also

You must be logged in to post a comment.

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

Skip to toolbar