autoship_checkout_price

filter: autoship_checkout_price

Allows you to override the checkout price for an Autoship product.

/**
 * @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);

Still need help? Contact Us Contact Us