autoship_checkout_price (filter)

(src/products.php) Allows developers to override the recurring price for an Autoship product. It takes the $checkout_price, $product_id, $frequency_type, & $frequency as its parameters.


Example: Apply an additional 10% discount only at Checkout for a product that includes a frequency of Every 1 Month

/**
 * @param: float $checkout_price
 * @param: int $product_id
 * @param: string $frequency_type
 * @param: int $frequency
 * @return float
 */
function autoship_checkout_price_example( $checkout_price, $product_id, $frequency_type, $frequency ) {
// Apply an additional 10% checkout discount for an Every 1 Month frequency
	if( $frequency_type == 'Months' && $frequency == 1 ) {
		return floor(  $checkout_price - ( $checkout_price * .1 )  );
	}	
}
add_filter( 'autoship_checkout_price', 'autoship_checkout_price_example', 10, 4);