shopp_shipping_fees

filters the total additional cart fee added to each shipping method.

add_filter( 'shopp_shipping_fees', [callback] )

@param float $fee the additional fee added to each shipping method.  Normally the total of per item handling fees and the cart handling fee.

Description

Filters the total additional cart fee added to each shipping method.

As of Shopp 1.3.5, shopp_shipping_fees can also provide the ShoppShiprateService object and the array of item fees. Use the parameter count argument of add_filter to request the additional parameters. Order-level shipping fees can be accessed by calling shopp_setting('order_shipfee').

Example

// register filter callback
// Uses min_max_shipfees_filter() as the callback, priority 10 and requests 2 extra parameters
add_filter('shopp_shipping_fees', 'min_max_shipfees_filter', 10, 2);

// create filter function
function min_max_shipfees_filter( $fee, ShoppShiprateService $Service, array $itemfees ) {
    // Get the order-level shipping fee
    $order_shipping_fee = shopp_setting('order_shipfee');

    // Use the Shiprate Service to determine minimum handling fee
    if ( 'standard' == $Service->slug && $fee < 5 )
        $fee = 5.00;
    } elseif ( 'expidited' == $Service->slug && $fee < 10 ) {
        $fee = 10.00;
    }

    // Set maximum additional handling fee to $100
    if ( $fee > 100 )
        $fee = 100.00;
    return $fee;
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar