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_filter( 'woocommerce_box_office_scan_permission', 'modify_woocommerce_box_office_scan_permission' ); | |
function modify_woocommerce_box_office_scan_permission( $has_permission ) { | |
// Do any required permission checks here | |
$has_permission = true; | |
return $has_permission; | |
} |
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
wc_google_analytics_pro()->get_integration()->custom_event( $event_name, $properties ); |
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
if ( ! function_exists( 'my_custom_event_function' ) ) { | |
function my_custom_event_function() { | |
wc_google_analytics_pro()->get_integration()->custom_event( 'Event name', array( 'Property name' => 'value' ) ); | |
} | |
add_action( 'hook_to_trigger_event_on', 'custom_event_function' ); | |
} |
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_filter( 'wcdrip_custom_fields', 'drip_add_first_last_fields', 10, 5 ); | |
function drip_add_first_last_fields( $filters, $email, $lifetime_value, $products, $order ) { | |
unset( $filters['name'] ); | |
$filters['first_name'] = $order->billing_first_name; | |
$filters['last_name'] = $order->billing_last_name; | |
return $filters; | |
} |
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_filter( 'wcdrip_checkout_subscribe_params', 'drip_make_optin_single' ); | |
add_filter( 'wcdrip_register_subscribe_params', 'drip_make_optin_single' ); | |
function drip_make_optin_single( $params ) { | |
$params['double_optin'] = false; | |
return $params; | |
} |
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_filter( 'woocommerce_photography_customers_can_change_visibility', '__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
/* | |
* Snippet to change password used for protecting PDF download | |
* Code goes in the functions.php file in your theme. | |
*/ | |
function wc_pdf_watermark_change_pdf_password( $order_id, $product_id ) { | |
// Use the order number for the password instead of the billing email | |
$order = wc_get_order( $order_id ); | |
return $order->get_order_number(); | |
} |
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
/* | |
* Snippet to hide price add-ons equal to zero. | |
* Code goes in the functions.php file in your theme. | |
*/ | |
add_filter( 'wc_nf_addons_format_cart_item_price' , 'wc_ninja_forms_hide_zero_price' ); | |
function wc_ninja_forms_hide_zero_price( $value ) { | |
$hide_price = ' (' . wc_price( '0.00' ) . ')'; |
OlderNewer