Skip to content

Instantly share code, notes, and snippets.

@ideadude
Created January 8, 2018 17:14
Show Gist options
  • Save ideadude/75c06cf8cf188fb694c49862a10c669b to your computer and use it in GitHub Desktop.
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
<?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);
}
@laurenhagan0306
Copy link

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment