Add to cart selected price radio button value in cart and display it on Cart page Woocommerce

I have create input radio with custom price on woocommerce single product page using the code below on my theme’s functions php:

add_action(“woocommerce_before_add_to_cart_button”,”options_on_single_product”,1);
function options_on_single_product(){
$price = get_post_meta( get_the_ID(), ‘_price’, true );

<label for=”custom_field”>
<input type=”radio” name=”custom_field” checked=”checked” value=”option1″> <?php echo wc_price( $price ) ;?> <br />

<input type=”radio” name=”custom_field” value=”option2″> <?php echo wc_price( $price*3 ) ;?>

</label> <br />

}

Now i want when click add to cart button ,the selected price value displayed on cart and cart page. Please help me to do this. Thanks

Read more here:: Add to cart selected price radio button value in cart and display it on Cart page Woocommerce

Leave a Reply

Your email address will not be published. Required fields are marked *