This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('ppcp_request_args', function ($args, $url){ | |
if (strpos($url,'capture') !== false) { | |
$args['headers']['PayPal-Mock-Response'] = '{"mock_application_codes": "INSTRUMENT_DECLINED"}'; | |
} | |
return $args; | |
}, 10, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('multilingualpress.metabox_after_relate_posts', function($context, $request) { | |
// get post meta value from source site | |
$sku = (string)$request->bodyValue( | |
'_sku', | |
INPUT_POST, | |
FILTER_SANITIZE_STRING | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function remove_ppcp_pui_for_products( $available_gateways ) { | |
// Not in backend (admin) | |
if( is_admin() ) | |
return $available_gateways; | |
// Set var default state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// removes PayPal smart buttons on single product page for bookable type products from WooCommerce Bookings plugin | |
function ppcp_remove_single_product_buttons( $enable_button, $product ){ | |
if ( $product->is_type( 'booking' ) ) { | |
$enable_button = false; | |
} | |
return $enable_button; | |
} | |
add_action( 'woocommerce_paypal_payments_product_supports_payment_request_button', 'ppcp_remove_single_product_buttons', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'sgo_js_minify_exclude', | |
function ( array $scripts ) { | |
$scripts_to_exclude = array( 'ppcp-smart-button', 'ppcp-oxxo', 'ppcp-pay-upon-invoice', 'ppcp-vaulting-myaccount-payments', 'ppcp-gateway-settings', 'ppcp-webhooks-status-page', 'ppcp-tracking' ); | |
return array_merge( $scripts, $scripts_to_exclude ); | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// removes PayPal smart buttons on single product page for subscription type products | |
function ppcp_remove_single_product_buttons( $enable_button, $product ){ | |
if ( $product->is_type( 'subscription' ) ) { | |
$enable_button = false; | |
} | |
return $enable_button; | |
} | |
add_action( 'woocommerce_paypal_payments_product_supports_payment_request_button', 'ppcp_remove_single_product_buttons', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_paypal_payments_basic_checkout_validation_enabled', function($enabled) { | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'remove_woothemes_updater_notice' ); | |
/** | |
* Remove the undismissable admin notice to install/activate the WooThemes Helper plugin. | |
*/ | |
function remove_woothemes_updater_notice() { | |
remove_action( 'admin_notices', 'woothemes_updater_notice' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Inpsyde\MultilingualPress\TranslationUi\Post\RelationshipContext; | |
add_action('multilingualpress.metabox_after_update_remote_product', | |
static function(RelationshipContext $context, WC_Product $remoteProduct, WC_Product $sourceProduct) { | |
$remoteSku = $remoteProduct->get_sku() ?? ''; | |
$remotePrice = $remoteProduct->get_price() ?? ''; | |
if (!empty($remoteSku) && !empty($remotePrice)) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('multilingualpress.metabox_after_relate_posts', function($context, $request) { | |
// get post meta value from source site | |
$ProductFeedELITEGtinValue = (string)$request->bodyValue( | |
'_woosea_gtin', | |
INPUT_POST, | |
FILTER_SANITIZE_STRING | |
); |