Snippets

Oscar García Arenas pricing in checkout only

Created by Oscar García Arenas last modified
<?php 
function stop_pricing_if_no_checkout() {
  
  $current_url   = home_url(add_query_arg(array(),$_SERVER['REQUEST_URI'] ) );
  $checkout_url  = wc_get_checkout_url();
  
  if ( substr( $current_url, 0, strlen( $checkout_url ) ) === $checkout_url ) {
	return false;
  }
  return true;
    
}
add_filter( 'wc_price_based_country_stop_princing', 'stop_pricing_if_no_checkout' );
?>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.