shopp_googlecheckout_build_request

filters the array of checkout-shopping-cart xml text sent to Google Checkout to process the checkout.

add_filter( 'shopp_googlecheckout_build_request', [callback] )

@param array $request array of checkout-shopping-cart xml text sent to Google Checkout to process the checkout.

Description

filters the array of checkout-shopping-cart xml text sent to Google Checkout to process the checkout.

Example

// register filter callback
add_filter('shopp_googlecheckout_build_request', 'shopp_googlecheckout_build_request_fltr');

// create filter function
function shopp_googlecheckout_build_request_fltr( $xml ) {
    $newxml = array();
    foreach ( $xml as $line ) {
        $newxml[] = $line;      
        if ( $line == '<items>' ) {
            // my custom item
            $newxml[] = '<item>';
                $newxml[] = '<item-name>HelloWorld 2GB MP3 Player</item-name>';
                $newxml[] = '<item-description>HelloWorld, the simple MP3 player</item-description>';
                $newxml[] = '<unit-price currency="USD">159.99</unit-price>';
                $newxml[] = '<quantity>1</quantity>';
            $newxml[] = '</item>';
        }

    }

    $xml = $newxml;
    return $xml;
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar