How to move / re-order LearnDash Gift a Course fields?

move / re-order LearnDash Gift a Course fields to the top

Messy order of gift ​fields on the checkout page could be caused by a priority value set incorrectly for these fields. Maybe the same number is set for all 4 fields. While it should be a sequence.

For example, we want to put all LearnDash Gift fields before billing_first_name, which has priority of 10 by default.

Then we need to assign priorities of 6,7,8,9 to all 4 gift fields accordingly. Not priority 9 to all four fields.

Here’s the code you need to paste into functions.php of your theme to move LearnDash Gift plugin fields up above the billing_first_name field:

These are some extra notes below this code.

P.S. If you want to move your LearnDash Gift fields to any other place than the very top of checkout form, here’s how you can achieve that.

On WooCommerce checkout page each field has a default priority value. And in the code above, I use values of 6, 7, 8, 9 for LearnDash Gift fields. This positions Gift fields before billing_first_name field, which has value of 10.

Following the same path and the code above, you could move LearnDash Gift fields to any position on WooCommerce checkout form.

Here is the summary of default priority values for all checkout fields:

GroupNamePriority
billingbilling_first_name10
billing_last_name20
billing_company30
billing_country40
billing_address_150
billing_address_260
billing_city70
billing_state80
billing_postcode90
billing_phone100
billing_email110
shippingshipping_first_name10
shipping_last_name20
shipping_company30
shipping_country40
shipping_address_150
shipping_address_260
shipping_city70
shipping_state80
shipping_postcode90
accountaccount_password
orderorder_comments