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
[ | |
{ | |
"id": "first-test-message", // required | |
"datePublished": "2020-07-07", // required | |
"visibility": { // all optional | |
"activePlugins": [ | |
"WooCommerce Checkout Add-Ons", | |
"WooCommerce Local Pickup Plus" | |
], | |
"activeThemes": [ |
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( 'wc_payment_gateway_transaction_response_user_message', 'sv_customize_avs_mismatch_message', 10, 3 ); | |
/** | |
* Customize AVS mismatch error message. | |
* | |
* @param string $message message to show to user | |
* @param string $message_id machine code for the message, e.g. card_expired | |
* @param SV_WC_Payment_Gateway_API_Response_Message_Helper $helper helper instance |
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( 'wc_braintree_transaction_data', 'sv_unset_transaction_source', 10, 2 ); | |
/** | |
* Unset the transaction source to prevent authorizations from expiring too soon. | |
* | |
* @param array $request_data The transaction/sale data | |
* @param \WC_Braintree_API_Transaction_Request $request the request object | |
* @return array |
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( 'wc_facebook_feed_generation_interval', function( $interval ) { | |
return HOUR_IN_SECONDS; | |
} ); |
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_checkout_add_on_get_enabled', function( $value, $checkout_add_on ) { | |
// bail if Memberships is not active | |
if ( ! function_exists( 'wc_memberships_is_user_member' ) ) { | |
return $value; | |
} | |
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_rest_prepare_wc_user_membership', function ( WP_REST_Response $response, $post, $request ) { | |
$membership = wc_memberships_get_user_membership( $post->ID ); | |
if ( $membership instanceof WC_Memberships_User_Membership ) { | |
$data = $response->get_data(); | |
$data['notes'] = $membership->get_notes(); |
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_get_product_terms', function ( $terms, $product_id, $taxonomy, $args ) { | |
if ( isset( $_GET['wc_pip_action'] ) && ! empty( $_GET['wc_pip_document'] ) && 'packing-list' == $_GET['wc_pip_document'] ) { | |
$terms = wp_get_post_terms( $product_id, $taxonomy, array( | |
'orderby' => 'parent', | |
'order' => 'DESC', | |
'exclude_tree' => '33', |
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( 'comments_array', function ( $comments_flat, $post_id ) { | |
$post = get_post( $post_id ); | |
// checks if the current post has any restricted content | |
if ( false !== strpos( $post->post_content, '[wcm_restrict' ) ) { | |
if ( ! wc_memberships_is_user_active_member() |
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 sv_add_filter_for_conditional_add_to_cart_fragments() { | |
// only make changes as long as Facebook for WooCommerce is installed | |
if ( function_exists( 'facebook_for_woocommerce' ) ) { | |
$events_tracker = facebook_for_woocommerce()->get_integration()->events_tracker; | |
$events_tracker->add_filter_for_conditional_add_to_cart_fragment(); | |
} |
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 the following snippet to your theme's functions.php file, or use a plugin like Code Snippets. | |
add_action( 'init', function() { | |
// Only make changes as long as Jilt for WooCommerce is installed and connected to Jilt | |
if ( function_exists( 'wc_jilt' ) && wc_jilt()->get_integration()->is_jilt_connected() ) { | |
// Disable Storefront JS for Phone Order carts |
NewerOlder