Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ideadude/161d596d5f60f084151898618799ed4f to your computer and use it in GitHub Desktop.
Save ideadude/161d596d5f60f084151898618799ed4f to your computer and use it in GitHub Desktop.
Hide the PMPro pricing box at checkout using the new pmpro_include_pricing_fields filter.
/**
* Hide the PMPro pricing box at checkout
* and replace with our own.
*
* Require PMPro v1.9.5.6+ and PMPro Sitewide Sales v1.0+
* Add this into a custom plugin.
*/
function override_pricing_fields_on_sitewide_sales_pages( $include_pricing_fields ) {
global $wpdb, $pmpro_level;
// Make sure PMPro SWS is active.
if( ! class_exists( 'PMPro_Sitewide_Sales\includes\classes\PMPro_SWS_Settings' ) ) {
return $include_pricing_fields;
}
// Hide the default pricing box.
if( PMPro_Sitewide_Sales\includes\classes\PMPro_SWS_Settings::is_active_sitewide_sale_landing_page() ) {
$include_pricing_fields = false;
// Show our own radio select and info/ect
?>
<div><p>Insert your custom level select or pricing info here.</p></div>
<?php
}
return $include_pricing_fields;
}
add_filter( 'pmpro_include_pricing_fields', 'override_pricing_fields_on_sitewide_sales_pages' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment