/**
  * Triggered when adding an item in the backend.
  *
  * If deposits are forced, set all meta data.
  */
 public function ajax_add_order_item_meta($item_id, $item)
 {
     if (WC_Deposits_Product_Manager::deposits_forced($item['product_id'])) {
         $product = wc_get_product(absint($item['variation_id'] ? $item['variation_id'] : $item['product_id']));
         woocommerce_add_order_item_meta($item_id, '_is_deposit', 'yes');
         woocommerce_add_order_item_meta($item_id, '_deposit_full_amount', $item['line_total']);
         woocommerce_add_order_item_meta($item_id, '_deposit_full_amount_ex_tax', $item['line_total']);
         if ('plan' === WC_Deposits_Product_Manager::get_deposit_type($item['product_id'])) {
             $plan_id = current(WC_Deposits_Plans_Manager::get_plan_ids_for_product($item['product_id']));
             woocommerce_add_order_item_meta($item_id, '_payment_plan', $plan_id);
         } else {
             $plan_id = 0;
         }
         // Change line item costs
         $deposit_amount = WC_Deposits_Product_Manager::get_deposit_amount($product, $plan_id, 'order', $item['line_total']);
         wc_update_order_item_meta($item_id, '_line_total', $deposit_amount);
         wc_update_order_item_meta($item_id, '_line_subtotal', $deposit_amount);
     }
 }
<div class="wc-deposits-wrapper <?php 
echo WC_Deposits_Product_Manager::deposits_forced($post->ID) ? 'wc-deposits-forced' : 'wc-deposits-optional';
?>
">
	
	<?php 
if (!WC_Deposits_Product_Manager::deposits_forced($post->ID)) {
    ?>
		<ul class="wc-deposits-option">
			<li><input type="radio" name="wc_deposit_option" value="yes" id="wc-option-pay-deposit" /><label for="wc-option-pay-deposit"><?php 
    _e("Pay Deposit", 'woocommerce-deposits');
    ?>
</label></li>
			<li><input type="radio" name="wc_deposit_option" value="no" id="wc-option-pay-full" /><label for="wc-option-pay-full"><?php 
    _e("Pay in Full", 'woocommerce-deposits');
    ?>
</label></li>
		</ul>
	<?php 
}
?>

	<?php 
if ('plan' === WC_Deposits_Product_Manager::get_deposit_type($post->ID)) {
    ?>
		<ul class="wc-deposits-payment-plans">
			<?php 
    $plans = WC_Deposits_Plans_Manager::get_plans_for_product($post->ID, true);
    foreach ($plans as $key => $plan) {
        ?>
				<li class="wc-deposits-payment-plan <?php