Add disclaimer to "Fee" at checkout - Woocommerce

Viewed 19

I'd like to add an accordion dropdown to my customer's "fee" at checkout. I'm using the code below but can't add "disclaimer" text to this. I'd love to be able to toggle this field so the customers have fewer questions. Do I need to add a hook a paragraph tag below the surcharge / fee? I'm new to woocommerce hooks.

function wc_add_surcharge() { 
global $woocommerce; 

if ( is_admin() && ! defined( 'DOING_AJAX' ) ) 
return;

$county = array('US');
// change the $fee to set the surcharge to a value to suit
$fee = 3.00;

if ( in_array( WC()->customer->get_shipping_country(), $county ) ) : 
    $woocommerce->cart->add_fee( 'Name of Fee', $fee, true, 'standard' );  
endif;
}

example image of what the accordion would look like

1 Answers

All you need to do is go to "review-order.php" and there is a $fee div. You can any custom code here and it will display in the "fee" section of checkout.

Related