add_action( 'woocommerce_before_add_to_cart_button', 'custom_product_addons', 10 ); function custom_product_addons() { global $product; $product_price = $product->get_price(); // Base price of the product. ?>

Select Additional Warranty:

get_cart() as $cart_item ) { if( isset( $cart_item['addon_price'] ) ) { $cart_item['data']->set_price( $cart_item['data']->get_price() + $cart_item['addon_price'] ); } } }