Skip to content

Instantly share code, notes, and snippets.

@swoboda
Created October 23, 2019 13:21
Show Gist options
  • Save swoboda/78fd3295ebd69d43cb33e7d76517ae6f to your computer and use it in GitHub Desktop.
Save swoboda/78fd3295ebd69d43cb33e7d76517ae6f to your computer and use it in GitHub Desktop.
Allow Flexible Pricing sales display on non-WooCommerce pages
<?php
// Do NOT include the opening php tag
add_filter( 'wc_flexible_pricing_on_get_price', 'wpdesk_wc_flexible_pricing_on_get_price' );
/**
* Allow Flexible Pricing sales on non-WooCommerce pages
*
*/
function wpdesk_wc_flexible_pricing_on_get_price( $on_get_price ) {
if ( is_page() ) {
$on_get_price = true;
}
return $on_get_price;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment