Embed Snippet on Your Site
MemberPress: Add Description for Order Bumps Memberships
The code snippet is designed to manually add a custom paragraph as a description for each order bump membership on registration pages.
The code snippet uses the order bumps class containing the order bumps membership ID - “mepr-order-bump-ID”.
The order bumps membership IDs should be updated for each description separately, the line containing the class name. For example, in the code above, for the order bumps membership with the ID of 14, this is the line containing the class name:
document.getElementsByClassName('mepr-order-bump-14')[0];
You can adjust the description for each order bumps membership, by editing the description text. In the example above, to adjust the description for the order bumps membership with the ID of 14, the Description for the order bumps membership ID 14. The text should be modified on this line:
p14.textContent = 'Description for the order bump membership ID 14.';
The new code block should be added just before the closing script tag to add more order bumps membership descriptions. For example, to add a description for order bumps membership with ID of 16:
// Set description for order bump membership ID 16
let product16 = document.getElementsByClassName('mepr-order-bump-16')[0];
if ( product16 ) {
let p16 = document.createElement('p');
p16.textContent = 'Description for the order bumps membership ID 16.';
product16.appendChild(p16);
}
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments