shopp_validate_checkout

filters the checkout validation status.

add_filter( 'shopp_validate_checkout', [callback] )

@param bool|ShoppError $validated will be true when the checkout form has validated without errors.

Description

filters the checkout validation status.

This filter should return true when no errors should occur on the checkout validation, and should return false or a ShoppError object when an checkout validation has failed and the checkout should not proceed.

Example

// register filter callback
add_filter('shopp_validate_checkout', 'shopp_validate_checkout_fltr');

// create filter function
function shopp_validate_checkout_fltr( $validated ) {
    if ( $validated ) {
        // check for my custom form field when the checkout form is submitted
        if ( ! isset($_POST['myfield']) && empty($_POST['myfield']) )
            return new ShoppError('You did not enter a response for myfield.');
    }

    return $validated;
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar