.elementor-186 .elementor-element.elementor-element-bf1b3df{--display:flex;--background-transition:0.3s;}@media(min-width:768px){.elementor-186 .elementor-element.elementor-element-bf1b3df{--content-width:50%;}}/* Start custom CSS for shortcode, class: .elementor-element-60da218 */<?php
/**
 * Show the top discount code field on the checkout page for Paid Memberships Pro.
 *
 * Set levels to show in the $level_ids_to_show_discount_code.
 * e.g. "$level_ids_to_show_discount_code = array( 1, 2 )" will show the discount code
 * field for levels 1 and 2, "$level_ids_to_show_discount_code = array()" will show
 * the discount code field for all levels.
 *
 * You can add this recipe to your site by creating a custom plugin
 * or using the Code Snippets plugin available for free in the WordPress repository.
 * Read this companion article for step-by-step directions on either method.
 * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
 */

function my_pmpro_always_show_discount_code() {
	global $pmpro_level;

	// Accepts an array of level IDs to show the discount code field for or an empty array to show for all levels.
	$level_ids_to_show_discount_code = array( 1, 3, 11 ); // Add the level IDs you want to show the discount code field for.

	if ( empty( $level_ids_to_show_discount_code ) || in_array( $pmpro_level->id, $level_ids_to_show_discount_code, false ) ) {
		?>
		<script>
			jQuery(document).ready(function() {
				jQuery('#other_discount_code_tr').show();
				jQuery('#other_discount_code_p').hide();
				jQuery('#other_discount_code').focus();
			});


		</script>
		<?php
	}
}
add_action( 'pmpro_checkout_before_submit_button', 'my_pmpro_always_show_discount_code' );/* End custom CSS */