Created
January 8, 2018 17:14
-
-
Save ideadude/75c06cf8cf188fb694c49862a10c669b to your computer and use it in GitHub Desktop.
Example to change which checkout level is used for modal checkout based on page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Define the default level to use for the modal | |
*/ | |
$uri = $_SERVER['REQUEST_URI']; | |
$page_slug = '/about'; | |
if( strpos($uri, $page_slug) !== false ) { | |
define('PMPRO_MODAL_CHECKOUT_DEFAULT_LEVEL', 2); | |
} else { | |
define('PMPRO_MODAL_CHECKOUT_DEFAULT_LEVEL', 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Process Membership Checkout in a Modal or Popover Window" at Paid Memberships Pro here: https://www.paidmembershipspro.com/process-membership-checkout-in-a-modal-or-popover-window/