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 // only copy this line if needed | |
/** | |
* Register Cart Notices texts for translation with WPML when the messages are first created/updated | |
*/ | |
add_filter( 'wc_cart_notices_update_fields', function( $fields ) { | |
if ( isset( $fields['name'] ) ) { | |
$slug = sanitize_title( $fields['name'] ); |
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 // only copy this line if needed | |
/** | |
* Charge a WooCommerce pre-order when the associated order is set to Completed status | |
* | |
* @param int $order_id | |
* @param \WC_Order $order | |
*/ | |
function sv_wc_charge_order_on_order_complete( $order_id, $order ) { |
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 // only copy this line if needed | |
function sv_facebook_for_wc_basel_theme_add_filter_for_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 // only copy this line if needed | |
add_action( 'init', function() { | |
if ( current_user_can( 'manage_options' ) && function_exists( 'facebook_for_woocommerce' ) && isset( facebook_for_woocommerce()->get_integration()->events_tracker ) ) { | |
$event_tracker = facebook_for_woocommerce()->get_integration()->events_tracker; | |
remove_action( 'woocommerce_thankyou', [ $event_tracker, 'inject_purchase_event' ], 40 ); | |
remove_action( 'woocommerce_payment_complete', [ $event_tracker, 'inject_purchase_event' ], 40 ); |
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 // only copy this line if needed | |
/** | |
* Filter the quantity input's pattern attribute to fix the "Please | |
* match the requested format" HTML validation error that occurs when using | |
* WooCommerce Measurement Price Calculator with certain premium themes | |
* | |
* @props to mensmaximus {@link https://github.com/mensmaximus} for the | |
* proposed solution | |
* |
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 // only copy this line if needed | |
add_filter( 'wc_customer_order_csv_export_order_headers', 'wc_product_vendors_csv_export_integration_add_column_headers' ); | |
add_filter( 'wc_customer_order_csv_export_order_line_item', 'wc_product_vendors_csv_export_integration_modify_line_item', 10, 5 ); | |
add_filter( 'wc_customer_order_csv_export_order_row_one_row_per_item', 'wc_product_vendors_csv_export_integration_add_row_data', 10, 4 ); | |
function wc_product_vendors_csv_export_integration_add_column_headers( $headers ) { | |
$headers['vendor'] = 'Vendor'; |
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 // only copy this line if needed | |
add_filter( 'wc_customer_order_export_auto_export_new_orders_only', '__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
<?php // only copy this line if needed | |
/** | |
* Add the utm_nooverride parameter to any return urls. This makes sure Google Adwords doesn't mistake the offsite gateway as the referrer. | |
* | |
* @link https://github.com/woothemes/woocommerce-google-analytics-integration/blob/c805bb4c24de235227c2b4b21b179d73bd8a7861/includes/class-wc-google-analytics.php#L506-L522 | |
* | |
* @param string $return_url WooCommerce Return URL | |
* @return string URL | |
*/ |
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 // only copy this line if needed | |
add_filter( 'wc_authorize_net_cim_credit_card_payment_form_tokenization_forced', '__return_true' ); |
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 // only copy this line if needed | |
function sv_wc_api_allow_acof_protected_meta() { | |
add_filter( 'is_protected_meta', 'sv_wc_acof_is_protected_meta', 10, 2 ); | |
} | |
add_action( 'woocommerce_api_loaded', 'sv_wc_api_allow_acof_protected_meta' ); | |
function sv_wc_acof_is_protected_meta( $protected, $meta_key ) { | |
if ( 0 === strpos( $meta_key, '_wc_acof_' ) ) { |
NewerOlder