Skip to content

Instantly share code, notes, and snippets.

@grantalltodavid
Created February 20, 2025 11:02
Show Gist options
  • Select an option

  • Save grantalltodavid/b4f39e3b9353f1df70aaf9f377ec13bc to your computer and use it in GitHub Desktop.

Select an option

Save grantalltodavid/b4f39e3b9353f1df70aaf9f377ec13bc to your computer and use it in GitHub Desktop.
Sliced Invoices: PayPal Gateway change NOSHIPPING parameter from 1 to 0
<?php
add_action( 'setted_transient', 'si20250220_change_paypal_params', 10, 3 );
function si20250220_change_paypal_params( $transient, $value, $expiration ) {
if ( strpos( $transient, 'sliced_paypal_' ) === 0 && strpos( $value, 'NOSHIPPING=1' ) !== false ) {
$value = str_replace( 'NOSHIPPING=1', 'NOSHIPPING=0', $value );
set_transient( $transient, $value, 60*60*24 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment