shopp_orderui_orderdata

filters the listed contents of the orderdata meta box in the Shopp Order Manager.

add_filter( 'shopp_orderui_orderdata', [callback] )

@param string $orderdata the listed contents of the orderdata meta box.

Description

filters the listed contents of the orderdata meta box in the Shopp Order Manager.

This content is created by the shopp(‘checkout’,’order-data’) on the checkout form, and displayed on the Shopp Order Manager in the WordPress Admin.

Example

// register filter callback
add_filter('shopp_orderui_orderdata', 'shopp_orderui_orderdata_filter');

// create filter function
function shopp_orderui_orderdata_filter( $orderdata ) {
    $list = explode("\n", $orderdata);

    foreach ( $list as $i => $li ) {
        // say you collected special financial information like so:
        // shopp('checkout', 'order-data', 'name=special');
        if ( false !== strpos($li, 'shopp_orderui_orderdata_special') ) {
            // Hide this orderdata if user isn't privileged
            if ( ! current_user_can('shopp_financials') ) unset($list[$i]);
        }
    }

    $orderdata = implode( "\n", $list );
    return $orderdata;
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar