From f341fe1b3fcbd1a07266724d3c2c809df20349b9 Mon Sep 17 00:00:00 2001 From: David Parker Date: Wed, 27 Mar 2024 12:29:24 -0400 Subject: [PATCH] Fix applying discount codes for outdated checkout templates --- js/pmpro-checkout.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/pmpro-checkout.js b/js/pmpro-checkout.js index ebe734b63..335d54a72 100644 --- a/js/pmpro-checkout.js +++ b/js/pmpro-checkout.js @@ -29,6 +29,10 @@ jQuery(document).ready(function(){ jQuery('#other_discount_code_button').click(function() { var code = jQuery('#pmpro_other_discount_code').val(); var level_id = jQuery('#pmpro_level').val(); + if ( ! level_id ) { + // If the level ID is not set, try to get it from the #level field for outdated checkout templates. + level_id = jQuery('#level').val(); + } if(code) {