<?php

/**
 * disable default form in checkout
 */
remove_action("woocommerce_proceed_to_checkout", [WC_GC()->cart, "display_form"], 9);
remove_action("woocommerce_review_order_before_payment", [WC_GC()->cart, "display_form"], 9);

/**
 * disable styles
 */
add_action("wp_print_styles", function () {
  wp_dequeue_style("wc-gc-css");
});

/**
 * add gift card form to checkout sidebar
 */
add_action(
  "rc_after_checkout_totals",
  function ($checkout, $settings) {
    WC_GC()->cart->display_form();
  },
  10,
  2
);
