Home / Archive / MemberPress: Add a description to Order Bumps on the registration page
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Add a description to Order Bumps on the registration page

In this example, a description is added to an Order Bump with a membership ID of 14 and one with a membership ID of 15. Replace 14 and 15 with the membership IDs of your Order Bumps. The ID can be found in the ID column on the WordPress Dashboard –> MemberPress –> Memberships page.

Code Preview
php
<?php
function mepr_order_bumps_desc() {
	?>
    <script>
		// Set description for order bump membership ID 14
		let product14 = document.getElementsByClassName('mepr-order-bump-14')[0];
		if ( product14 ) {
			let p14 = document.createElement('p');
			p14.textContent = 'Description about the order bump membership ID 14 here.';
			product14.appendChild(p14);
		}
		// Set description for order bump membership ID 15
		let product15 = document.getElementsByClassName('mepr-order-bump-15')[0];
		if ( product15 ) {
			let p15 = document.createElement('p');
			p15.textContent = 'Description about the order bump membership ID 15 here.';
			product15.appendChild(p15);
		}
    </script>
    <?php
}
add_action( 'wp_footer', 'mepr_order_bumps_desc' );

Comments

Add a Comment