shopp('checkout.clickwrap')

Displays a scrollable clickwrap agreement, with a required checkbox input for agreement.

shopp('checkout', 'clickwrap', '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, clickwrap markup when return option is used

Alternative Forms

shopp('checkout.clickwrap', 'options');

Description

Displays a scrollable clickwrap agreement, with a required checkbox input for agreement.

This tag is useful for creating a terms of sale that the user must agree to before proceeding with the sale. The value of the checkbox will be stored in the order data under the name clickwrap.

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.

Options

The following options are valid.

  • mode: ‘input’ (default) to display the input, ‘value’ to display the current value (agreed/no, if the clickwrap has been agreed to.)
  • agreement: the slug or page path of the content to be displayed in the clickwrap scrolling div.
  • termclass: the space separated list of classes to add to the clickwrap scrollable div.
  • value: specify the current value of the checkbox input, ‘agreed’ to check the box.

Checkout Input Options

These options can be added to alter the attributes of the checkbox input.

  • 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′.
  • 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.
  • value: option for the value input attribute. The option’s value is output as the attribute.

Examples

// display the content of the page with slug "terms-and-conditions", and the default checkbox input
shopp('checkout', 'clickwrap','agreement=terms-and-conditions');
// display the content of the page with slug "terms", and the default checkbox input
// force user to check the box each time they submit
shopp('checkout', 'clickwrap','agreement=terms&value=no');

Just a link with a checkbox

<?php shopp('checkout.clickwrap','title=Please accept terms and conditions'); ?><a href="http://example.com/terms">Agree to Terms and Conditions</a>

See Also

You must be logged in to post a comment.

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

Skip to toolbar